Implementation of Shore, Foulds and Gibbons exact branch and bound algorithm for solving Steiner tree problems.
More...
|
T | bnbInternal (T prevCost, List< edge > ¤tEdges) |
| Calculates the optimal Steinter tree recursivly.
|
|
edge | deleteEdge (edge e) |
| Removes the specified edge from the graph.
|
|
edge | determineBranchingEdge (T prevCost) const |
| Decides which edge to branch on.
|
|
bool | isTerminal (const node v) const |
| Returns whether this node is a terminal or a Steiner node.
|
|
edge | lookupEdge (const node u, const node v) const |
| Retrieves the edge incident to both node u and v.
|
|
void | moveSource (edge e, node v) |
| Moves the source of the edge to the specified node.
|
|
void | moveTarget (edge e, node v) |
| Moves the target of the edge to the specified node.
|
|
edge | newEdge (node source, node target, const edge originalEdge) |
| Creates a new edge.
|
|
void | printSVG () |
| Prints the current recursion status as a SVG image of the current reduced STP.
|
|
void | setEdgeLookup (const node u, const node v, const edge e) |
| Sets the edge incident to both node u and v.
|
|
void | setTerminal (const node v, bool makeTerminal) |
| Updates the status of the given node to either terminal or Steiner node.
|
|
T | solve (List< edge > &chosenEdges) |
| Solves the current STP instance.
|
|
bool | validateMapping () const |
| Used to validate the current mapping of edges to orignal edges Used solely for debugging.
|
|
T | weightOf (edge e) const |
| Returns the cost of the specified edge.
|
|
|
static void | getNonterminals (ArrayBuffer< node > &nonterminals, const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal) |
| Generates a list (as ArrayBuffer<node>) of all nonterminals.
|
|
static void | getTerminals (List< node > &terminals, const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal) |
| Generates a list (as List<node>) of all terminals.
|
|
static bool | isQuasiBipartite (const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal) |
| Checks in O(n + m) time if a given Steiner tree problem instance is quasi-bipartite.
|
|
static bool | isSteinerTree (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, const EdgeWeightedGraphCopy< T > &steinerTree) |
| Checks in O(n) time if a given tree is acually a Steiner Tree.
|
|
static void | sortTerminals (List< node > &terminals) |
| Sort terminals by index.
|
|
static T | pruneAllDanglingSteinerPaths (EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal) |
| Prunes nonterminal leaves and their paths to terminal or branching nodes.
|
|
static T | pruneDanglingSteinerPathFrom (EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal, node start) |
| Prunes the dangling Steiner path beginning at a given nonterminal leaf only.
|
|
static T | pruneDanglingSteinerPathsFrom (EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal, const List< node > &start) |
| Prunes dangling Steiner paths beginning at given nonterminal leaves only.
|
|
static T | removeCyclesFrom (EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal) |
| Remove remaining cycles from a Steiner "almost" tree.
|
|
static void | singleSourceShortestPathsPreferringTerminals (const EdgeWeightedGraph< T > &G, node source, const NodeArray< bool > &isTerminal, NodeArray< T > &distance, NodeArray< edge > &pred) |
| Modified single-source-shortest-paths (Dijkstra) with heuristic to prefer paths over terminals.
|
|
static void | singleSourceShortestPathsStandard (const EdgeWeightedGraph< T > &G, node source, const NodeArray< bool > &, NodeArray< T > &distance, NodeArray< edge > &pred) |
| Standard single-source-shortest-paths algoritm (Dijkstra)
|
|
static void | singleSourceShortestPaths (const EdgeWeightedGraph< T > &G, node source, const NodeArray< bool > &isTerminal, NodeArray< T > &distance, NodeArray< edge > &pred) |
| The default single-source-shortest-paths algorithm.
|
|
static void | allTerminalShortestPathsStandard (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred) |
| Runs singleSourceShortestPathsStandard from all terminals.
|
|
static void | allTerminalShortestPathsPreferringTerminals (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred) |
| Runs singleSourceShortestPathsPreferringTerminals from all terminals.
|
|
static void | allTerminalShortestPaths (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred, std::function< void(const EdgeWeightedGraph< T > &, node, const NodeArray< bool > &, NodeArray< T > &, NodeArray< edge > &)> ssspFunc=singleSourceShortestPaths) |
| Runs a given (or the default) single-source-shortest-paths function from all terminals.
|
|
static void | allNodeShortestPathsStandard (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred) |
| Runs singleSourceShortestPathsStandard from all nodes.
|
|
static void | allNodeShortestPathsPreferringTerminals (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred) |
| Runs singleSourceShortestPathsPreferringTerminals from all nodes.
|
|
static void | allNodeShortestPaths (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred, std::function< void(const EdgeWeightedGraph< T > &, node, const NodeArray< bool > &, NodeArray< T > &, NodeArray< edge > &)> ssspFunc=singleSourceShortestPaths) |
| Runs a given (or the default) single-source-shortest-paths function from all nodes.
|
|
static void | allPairShortestPathsPreferringTerminals (const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred) |
| Modified all-pair-shortest-paths algorithm (Floyd-Warshall) with heuristic to prefer paths over terminals.
|
|
static void | allPairShortestPathsStandard (const EdgeWeightedGraph< T > &G, const NodeArray< bool > &, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred) |
| Standard all-pair-shortest-paths algorithm (Floyd-Warshall)
|
|
static void | allPairShortestPaths (const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred) |
| The default all-pair-shortest-paths algorithm.
|
|
static void | drawSVG (const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal, const EdgeWeightedGraphCopy< T > &steinerTree, const char *filename) |
| Writes an SVG file of a minimum Steiner tree in the original graph.
|
|
static void | drawSVG (const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal, const char *filename) |
| Writes an SVG file of the instance graph.
|
|
static void | drawSteinerTreeSVG (const EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal, const char *filename) |
| Writes a SVG that shows only the given Steiner tree.
|
|
template<typename T>
class ogdf::MinSteinerTreeShore< T >
Implementation of Shore, Foulds and Gibbons exact branch and bound algorithm for solving Steiner tree problems.
(Shore M.L., Foulds, L.R., and Gibbons, P.B. An Algorithm for the Steiner Problem in Graphs Networks 10:323-333, 1982.)
Definition at line 71 of file MinSteinerTreeShore.h.