32 #ifndef GUM_DAG_CYCLE_DETECTOR_H 33 #define GUM_DAG_CYCLE_DETECTOR_H 70 virtual ~
Change() noexcept;
86 NodeId tail()
const noexcept;
89 NodeId head()
const noexcept;
326 Size multiplier)
const;
331 Size multiplier)
const;
338 const NodeSet& extrmities)
const;
343 #ifndef GUM_NO_INLINE 345 #endif // GUM_NOINLINE 347 #endif // GUM_DAG_CYCLE_DETECTOR_H A class for detecting directed cycles in DAGs when trying to apply many changes to the graph...
~DAGCycleDetector()
destructor
DiGraph __dag
the initial dag from which modifications are applied
the base class indicating the possible changes
void eraseArc(NodeId x, NodeId y)
removes an arc from the current DAG
void __addWeightedSet(NodeProperty< Size > &nodeset, const NodeProperty< Size > &set_to_add, Size multiplier) const
adds a weighted nodeset to another (weights are added)
void addArc(NodeId x, NodeId y)
adds a new arc to the current DAG
void __delWeightedSet(NodeProperty< Size > &nodeset, const NodeProperty< Size > &set_to_del, Size multiplier) const
removes a weighted nodeset from another (weights are subtracted)
void __restrictWeightedSet(NodeProperty< Size > &result_set, const NodeProperty< Size > &set_to_restrict, const NodeSet &extrmities) const
put into a weighted nodeset the nodes of another weighted set that belong to a set of arc extremities...
ChangeType __type
the type of modification
the class to indicate that we wish to reverse an arc
gum is the global namespace for all aGrUM entities
The class for generic Hash Tables.
A class for detecting directed cycles in DAGs when trying to apply many changes to the graph...
bool hasCycleFromModifications(const std::vector< Change > &modifs) const
indicates whether a set of modifications would create a cycle
DAGCycleDetector & operator=(const DAGCycleDetector &from)
copy operator
void setDAG(const DAG &dag)
sets the initial DAG from which changes shall be applied
the class to indicate that we wish to add a new arc
Base class for all oriented graphs.
NodeId __head
the head of the arc to be modified
bool operator!=(const DAGCycleDetector &from) const
check the inequality between two DAGCycleDetectors
bool hasCycleFromAddition(NodeId x, NodeId y) const noexcept
indicates whether an arc addition would create a cycle
NodeId __tail
the tail of the arc to be modified
NodeProperty< NodeProperty< Size > > __descendants
the set of descendants of each node in the dag
NodeProperty< NodeProperty< Size > > __ancestors
the set of ancestors of each node in the dag
bool hasCycleFromReversal(NodeId x, NodeId y) const noexcept
indicates wether an arc reversal would create a cycle
bool hasCycleFromDeletion(NodeId x, NodeId y) const noexcept
indicates whether an arc deletion would create a cycle
std::size_t Size
In aGrUM, hashed values are unsigned long int.
DAGCycleDetector() noexcept
default constructor
the class to indicate that we wish to remove an arc
bool operator==(const DAGCycleDetector &from) const
check the equality between two DAGCycleDetectors
Size NodeId
Type for node ids.
Base classes for directed acyclic graphs.
void reverseArc(NodeId x, NodeId y)
reverses an arc from the DAG