This module provides basic algorithms for graphs. This section allows you to access the C++ source files of the module. This module is part of Bpp/Graph . The files listed below are included in the interface part of the module. So any module dependent of this module is also dependent of the files listed here. The files listed below are needed by the implementation part of the module. But a module dependent of this module is not necessary dependent of the files listed here. The namespaces listed below are integrated in this module. That means any element declared in one of those namespaces can now be directly used by or from this module. The aliases listed below are only used internally by the interface. They are here just to lighten the writing of certain declarations. Never use them, they are local to the interface and can not be used outside of it. tdGraph = class prArcData,class prNodeData
tuGraph = prArcData,prNodeData
Here are listed the types defined in the module. To use one of them, you have to specify the namespace of the module. type std_map(tyArcKey,tyInteger) clCocycle Cocycle of a graph (association of arc keys with their direction in the cocycle).
type std_map(tyArcKey,tyInteger) clCycle Cycle of a graph (association of arc keys with their direction in the cycle).
type std_vector(clCocycle) clCocycleS List of cocycles.
type std_vector(clCycle) clCycleS List of cycles.
enumeration { green, black, blue, red } tyMintyColor Symbolic constants for the colors used by a Minty coloration.
Here are listed the errors that are supported or generated by the module. To use one of them, you do not have to specify the namespace of the module. Here are listed the functions provided by the module. To use one of them, you have to specify the namespace of the module. template <tdGraph> inline clNode<tuGraph> * firstNode(const clGraph<tuGraph> & agGraph) Returns the node of a graph that has no predecessor. If no such node exists or if more than one such node exist, then nil is returned.
template <tdGraph> inline clNode<tuGraph> * lastNode(const clGraph<tuGraph> & agGraph) Returns the node of a graph that has no successor. If no such node exists or if more than one such node exist, then nil is returned.
template <tdGraph> inline tyBoolean findCircuit(clGraph<tuGraph> & agGraph,tyArcKey agArcKey,clCycle & agCircuit) Finds a circuit containing a given arc. Returns false if there is no such circuit. The result is a list containing the arc keys of the circuit with their direction (always +1).
template <tdGraph> inline tyBoolean findCycle(clGraph<tuGraph> & agGraph,tyArcKey agArcKey,clCycle & agCycle) Finds a cycle containing a given arc. Returns false if there is no such cycle. The result is a list containing the arc keys of the cycle with their direction.
template <tdGraph> inline tyBoolean findCircuit(clArc<tuGraph> & agArc,std_map(clArc<tuGraph> *,tyInteger) & agCircuit) Finds a circuit containing a given arc. Returns false if there is no such circuit. The result is a list containing the arc memory pointers of the circuit with their direction (always +1).
template <tdGraph> inline tyBoolean findCycle(clArc<tuGraph> & agArc,std_map(clArc<tuGraph> *,tyInteger) & agCycle) Finds a cycle containing a given arc. Returns false if there is no such cycle. The result is a list containing the arc memory pointers of the cycle with their direction.
template <tdGraph> inline tyBoolean findTopologicalOrdering(clGraph<tuGraph> & agGraph,std_vector(clNode<tuGraph> *) & agNodeS) Finds a topological ordering of the nodes of a graph. There must be no circuit. Returns true if an ordering is found. The result is an ordered list containing the node memory pointers.
template <tdGraph> void eliminateNonCycles(clGraph<tuGraph> & agGraph) Eliminates the arcs and the nodes of a graph that do not belong to any cycle.
template <tdGraph> void findCocycle(const std_vector(clNode<tuGraph> *) & agNodeS,std_vector(clArc<tuGraph> *) & agIncomingArcS,std_vector(clArc<tuGraph> *) & agOutgoingArcS) Finds the cocycle that separates a group of nodes from the rest of a graph. The result is the list of the incoming arcs and the list of the outgoing arcs.
template <tdGraph> void findCocycle(const std_vector(clNode<tuGraph> *) & agNodeS,clCocycle & agCocycle) Finds the cocycle that separates a group of nodes from the rest of a graph. The result is a list containing the arc keys and their direction in the cocycle.
template <tdGraph> void findCocycle(const std_vector(clNode<tuGraph> *) & agNodeS,std_map(clArc<tuGraph> *,tyInteger) & agCocycle) Finds the cocycle that separates a group of nodes from the rest of a graph. The result is a list containing the arc memory pointers and their direction in the cocycle.
template <tdGraph> void findCycles(clGraph<tuGraph> & agGraph,clCycleS & agCycleS,tyBoolean agShort) Finds as independent cycles as possible in the graph. Any cycle in the graph is a linear combination of these cycles. In other word, any cycle in the graph can be recomposed from those cycles. The result is a list of cycles, each cycle is a list containing the arc keys and their direction in the cycle. The algorithm can be forced to find short cycles (default is not).
template <tdGraph> void findCycles(clGraph<tuGraph> & agGraph,std_vector(std_map(clArc<tuGraph> *,tyInteger)) & agCycleS,tyBoolean agShort) Finds as independent cycles as possible in the graph. Any cycle in the graph is a linear combination of these cycles. In other word, any cycle in the graph can be recomposed from those cycles. The result is a list of cycles, each cycle is a list containing the arc memory pointers and their direction in the cycle. The algorithm can be forced to find short cycles (default is not).
template <tdGraph> void findFirstNodes(const clGraph<tuGraph> & agGraph,std_vector(clNode<tuGraph> *) & agNodeS) Finds in a graph the nodes that have no predecessor.
template <tdGraph> void findLastNodes(const clGraph<tuGraph> & agGraph,std_vector(clNode<tuGraph> *) & agNodeS) Finds in a graph the nodes that have no successor.
template <tdGraph> tyNodeKey addSourceNode(clGraph<tuGraph> & agGraph,const prArcData & agArcData,const prNodeData & agNodeData) Adds a node to a graph. This node becomes the predecessor of all the nodes that had not one.
template <tdGraph> tyNodeKey addTargetNode(clGraph<tuGraph> & agGraph,const prArcData & agArcData,const prNodeData & agNodeData) Adds a node to a graph. This node becomes the successor of all the nodes that had not one.
template <tdGraph,class prMintyColor> tyBoolean findMintyCycle(clGraph<tuGraph> & agGraph,tyArcKey agKey,const prMintyColor & agTest,clCycle & agCycle,clCocycle & agCocycle) Finds a cycle or a cocycle according to a Minty coloration. It searchs a cycle that contains a given arc x. Moreover any other arc in the cycle must be green, blue or black. Green arcs can be in the same direction as x or in the opposite direction, blue arcs must be in the opposite direction and black ones in the same direction. If no such cycle exists, there must be a cocycle containing x that have only red, blue and black arcs. Red arcs can be in the same direction as x or in the opposite direction, blue arcs must be in the opposite direction and black ones in the same direction. The result is a list containing the arc keys with their direction.
template <tdGraph,class prMintyColor> tyBoolean findMintyCycle(clArc<tuGraph> & agArc,const prMintyColor & agTest,std_map(clArc<tuGraph> *,tyInteger) & agCycle,std_map(clArc<tuGraph> *,tyInteger) & agCocycle) Finds a cycle or a cocycle according to a Minty coloration. It searchs a cycle that contains a given arc x. Moreover any other arc in the cycle must be green, blue or black. Green arcs can be in the same direction as x or in the opposite direction, blue arcs must be in the opposite direction and black ones in the same direction. If no such cycle exists, there must be a cocycle containing x that have only red, blue and black arcs. Red arcs can be in the same direction as x or in the opposite direction, blue arcs must be in the opposite direction and black ones in the same direction. The result is a list containing the arc memory pointers with their direction.
template <tdGraph> void findCoveringTree(clGraph<tuGraph> & agGraph,clGraph<tuGraph> & agTree) Finds a covering tree in a graph.
template <tdGraph> clOutStream & operator << (clOutStream & agStream,const std_map(clArc<tuGraph> *,tyInteger) & agCycle) Writes a cycle or a cocycle into a stream.
template <tdGraph,class prArcAdmissibility> tyBoolean findTopologicalOrdering(clGraph<tuGraph> & agGraph,const prArcAdmissibility & agTest,std_vector(clNode<tuGraph> *) & agNodeS) Finds a topological ordering of the nodes of a graph. There must be no circuit. Returns true if an ordering is found. The result is an ordered list containing the node memory pointers. An object with the clArcAdmissibility interface is given to indicate if an arc must be used (in the direct or indirect direction) during the search. Check the clArcAdmissibility class for more details.
function clOutStream & operator << (clOutStream & agStream,ctCycle & agCycle) Writes a cycle or a cocycle into a stream.
Here are listed the classes provided by the module. To use one of them, you have to specify the namespace of the module. template <tdGraph> class clArcAdmissibility
This class represents arc admissibility. It is used to know if an arc is admissible or not, using it in the direct or indirect direction. This object is given as argument to functions that search nodes in a graph where only admissible arcs are used (in the direction(s) they are admissible for). This class is abstract. | clDecreaseDegreeNodeOrder | |
template <tdGraph> class clDecreaseDegreeNodeOrder
This class represents an ordering between two nodes, based on their degree. x is before y if its degree is greater than y's one. It is a functor that can be used by STL functions to sort nodes. | clIncreaseDegreeNodeOrder | |
template <tdGraph> class clIncreaseDegreeNodeOrder
This class represents an ordering between two nodes, based on their degree. x is before y if its degree is lower than y's one. It is a functor that can be used by STL functions to sort nodes. template <tdGraph> class clMintyColor
This class represents a Minty coloration. It is used to define the color wanted for the arcs of a graph. This object is given as argument to the Minty cycle search function. This class is abstract. | | Copyright (c) 1999-2016 - Bruno Bachelet - bruno@nawouak.net - http://www.nawouak.net | Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation. See this license for more details (http://www.gnu.org). |
|
| |