27 #ifndef GUM_STATIC_TRIANGULATION_H 28 #define GUM_STATIC_TRIANGULATION_H 32 #include <agrum/agrum.h> 34 #include <agrum/tools/graphs/algorithms/triangulations/eliminationStrategies/eliminationSequenceStrategy.h> 35 #include <agrum/tools/graphs/algorithms/triangulations/junctionTreeStrategies/junctionTreeStrategy.h> 36 #include <agrum/tools/graphs/algorithms/triangulations/triangulation.h> 37 #include <agrum/tools/graphs/cliqueGraph.h> 90 virtual void setGraph(
const UndiGraph* graph,
91 const NodeProperty< Size >* domsizes);
177 const JunctionTreeStrategy& JTStrategy,
178 bool minimality =
false);
195 const NodeProperty< Size >* dom_sizes,
196 const EliminationSequenceStrategy& elimSeq,
197 const JunctionTreeStrategy& JTStrategy,
198 bool minimality =
false);
319 std::vector< Arc >& merged_cliques,
320 NodeSet& mark)
const;
328 #ifndef GUM_NO_INLINE 329 # include <agrum/tools/graphs/algorithms/triangulations/staticTriangulation_inl.h> bool has_max_prime_junction_tree__
indicates whether a maximal prime subgraph junction tree has been constructed
const CliqueGraph & junctionTree()
returns a compatible junction tree
const UndiGraph & triangulatedGraph()
returns the triangulated graph
bool has_elimination_tree__
a boolean indicating whether the elimination tree has been computed
void computeMaxPrimeMergings__(const NodeId node, const NodeId from, std::vector< Arc > &merged_cliques, NodeSet &mark) const
used for computing the junction tree of the maximal prime subgraphs
EdgeSet fill_ins__
the fill-ins added during the whole triangulation process
const UndiGraph * originalGraph() const
returns the graph to be triangulated
void clear()
reinitialize the graph to be triangulated to an empty graph
void setMinimalRequirement(bool)
sets/unset the minimality requirement
virtual bool isMinimalityRequired() const final
indicates wether minimality is required
const CliqueGraph * junction_tree__
the junction tree computed by the algorithm
StaticTriangulation(StaticTriangulation &&)
forbid move constructor except in children's constructors
EliminationSequenceStrategy * elimination_sequence_strategy_
the elimination sequence strategy used by the triangulation
std::vector< NodeId > elim_order__
the order in which nodes are eliminated by the algorithm
bool minimality_required__
indicates whether the triangulation must be minimal
bool has_junction_tree__
a boolean indicating whether the junction tree has been constructed
virtual ~StaticTriangulation()
destructor
INLINE void emplace(Args &&... args)
void triangulate__()
the function that performs the triangulation
const EdgeSet & fillIns()
returns the fill-ins added by the triangulation algorithm
StaticTriangulation(const StaticTriangulation &)
forbid copy constructor except in newfactory
CliqueGraph max_prime_junction_tree__
the maximal prime subgraph junction tree computed from the junction tree
bool has_triangulation__
a boolean indicating whether we have parformed a triangulation
bool has_triangulated_graph__
a boolean indicating whether we have constructed the triangulated graph
CliqueGraph elim_tree__
the elimination tree computed by the algorithm
const UndiGraph * original_graph__
a pointer to the (external) original graph (which will be triangulated)
bool has_fill_ins__
indicates whether we actually computed fill-ins
StaticTriangulation(const UndiGraph *graph, const NodeProperty< Size > *dom_sizes, const EliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false)
constructor with a given graph
NodeProperty< NodeId > node_2_max_prime_clique__
indicates which clique of the max prime junction tree was created by the elmination of a given node (...
NodeId createdMaxPrimeSubgraph(const NodeId id)
returns the Id of the maximal prime subgraph created by the elimination of a given node during the tr...
void computeMaxPrimeJunctionTree__()
computes the junction tree of the maximal prime subgraphs
Idx eliminationOrder(const NodeId)
returns the index of a given node in the elimination order (0 = first node eliminated) ...
JunctionTreeStrategy & junctionTreeStrategy() const
returns the junction tree strategy used by the triangulation
const CliqueGraph & eliminationTree()
returns the elimination tree of a compatible ordering
bool we_want_fill_ins__
a boolean indicating if we want fill-ins list with the standard triangulation method ...
NodeProperty< NodeId > reverse_elim_order__
the elimination order (access by NodeId)
void setFillIns(bool)
sets/unsets the record of the fill-ins in the standard triangulation procedure
const NodeProperty< NodeId > & reverseEliminationOrder()
returns a table indicating, for each node, at which step it was deleted by the triangulation process ...
NodeProperty< NodeSet > elim_cliques__
the cliques formed by the elimination of the nodes
const std::vector< NodeId > & eliminationOrder()
returns an elimination ordering compatible with the triangulated graph
virtual void initTriangulation_(UndiGraph &graph)
the function called to initialize the triangulation process
virtual StaticTriangulation * copyFactory() const =0
virtual copy constructor
virtual StaticTriangulation * newFactory() const =0
returns a fresh triangulation of the same type as the current object but over an empty graph ...
EliminationSequenceStrategy & eliminationSequenceStrategy() const
returns the elimination sequence strategy used by the triangulation
const NodeProperty< NodeId > & createdJunctionTreeCliques()
returns the Ids of the cliques of the junction tree created by the elimination of the nodes ...
std::vector< EdgeSet > added_fill_ins__
a vector containing the set of fill-ins added after each node elimination (used by recursive thinning...
void computeRecursiveThinning__()
removes redondant fill-ins and compute proper elimination cliques and order
base class for all non-incremental triangulation methods
JunctionTreeStrategy * junction_tree_strategy_
the junction tree strategy used by the triangulation
virtual void setGraph(const UndiGraph *graph, const NodeProperty< Size > *domsizes)
initialize the triangulation data structures for a new graph
void computeEliminationTree__()
returns an elimination tree from a triangulated graph
UndiGraph triangulated_graph__
the triangulated graph
StaticTriangulation & operator=(const StaticTriangulation &)
forbid copy operator
const CliqueGraph & maxPrimeSubgraphTree()
returns a junction tree of maximal prime subgraphs
NodeId createdJunctionTreeClique(const NodeId id)
returns the Id of the clique of the junction tree created by the elimination of a given node during t...
StaticTriangulation(const EliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false)
default constructor: without any graph