C++ Reference: class ListGraph
Note: This documentation is automatically generated.
Method | |
---|---|
AddArc | Return type: Arguments: Adds an arc to the graph and returns its current index which will always be num_arcs() - 1. It will also automatically call AddNode(tail) and AddNode(head). It will fail in DEBUG mode if the capacities are fixed and this cause the graph to grow beyond them. Note: Self referencing arcs and duplicate arcs are supported. |
AddNode | Return type: Arguments: If node is not a valid node, sets num_nodes_ to node + 1 so that the given node becomes valid. It will fail in DEBUG mode if the capacities are fixed and the new node is out of range. |
Build | Return type: Some graph implementations need to be finalized with Build() before they can be used. After Build() is called, the arc indices (which had been the return values of previous AddArc() calls) may change: the new index of former arc #i will be stored in permutation[i] if #i is smaller than permutation.size() or will be unchanged otherwise. If you don't care about these, just call the simple no-output version Build(). Note that some implementations become immutable after calling Build(). |
Build | Return type: Arguments: |
Head | Return type: Arguments: |
ListGraph | |
ListGraph | Arguments: Reserve space for the graph at construction and do not allow it to grow beyond that, see FreezeCapacities(). This constructor also makes any nodes in [0, num_nodes) valid. |
OutDegree | Return type: Arguments: Graph jargon: the "degree" of a node is its number of arcs. The out-degree is the number of outgoing arcs. The in-degree is the number of incoming arcs, and is only available for some graph implementations, below. ListGraph<>::OutDegree() works in O(degree). |
OutgoingArcs | Return type: Arguments: Allows to iterate over the forward arcs that verify Tail(arc) == node. This is meant to be used as: for (const ArcIndex arc : graph.OutgoingArcs(node)) { ... } |
OutgoingArcsStartingFrom | Return type: Arguments: Advanced usage. Same as OutgoingArcs(), but allows to restart the iteration from an already known outgoing arc of the given node. |
ReserveArcs | Return type: Arguments: |
ReserveNodes | Return type: Arguments: |
Tail | Return type: Arguments: Returns the tail/head of a valid arc. |