Static Public Member Functions

# BinNavi.API.helpers.GraphAlgorithms Class Reference

Standard graph algorithms. More...

List of all members.

## Static Public Member Functions
static< TextendsIGraphNode< T > HashMap< T, ArrayList< T > > | getBackEdges (final IDirectedGraph< T,?> graph, final T rootNode) throws MalformedGraphException
| Calculates the back edges of the current graph.
static< TextendsIGraphNode< T > Tree< T > | getDominatorTree (final IDirectedGraph< T,?> graph, final T rootNode, final HashMap< T, ITreeNode< T >> mapping) throws MalformedGraphException
static< TextendsIGraphNode< T > ArrayList< Set< T > > | getGraphLoops (final IDirectedGraph< T,?> graph) throws MalformedGraphException
| Calculates the loops contained in a graph.
static < NodeTypeextendsIGraphNode < NodeType > Set< NodeType > | getLoopNodes (final NodeType srcNode, final NodeType dstNode)
| Gets the nodes of a loop.
static < NodeTypeextendsIGraphNode < NodeType > Set< NodeType > | getPredecessors (final NodeType node)
| Returns the predecessors of a graph node.
static < NodeTypeextendsIGraphNode < NodeType > Set< NodeType > | getSuccessors (final NodeType node)
| Returns the successors of a graph node.

## Detailed Description

Provides a few standard graph algorithms that might be useful when working with graphs.

## Member Function Documentation

static <TextendsIGraphNode<T> HashMap<T, ArrayList<T> > BinNavi.API.helpers.GraphAlgorithms.getBackEdges | ( | final IDirectedGraph< T,?> | graph,
|  | final T | rootNode |
| ) |  |  | throws MalformedGraphException `[static]`

Calculates the back edges of the current graph.

Parameters:

  | graph | The input graph.
  | rootNode | The root node of the graph.

Returns:
  A HashMap which contains the relation of nodes and their respective back edges.

Exceptions:

  | MalformedGraphException | Thrown if the graph has more then one entry node.

static <TextendsIGraphNode<T> Tree<T> BinNavi.API.helpers.GraphAlgorithms.getDominatorTree | ( | final IDirectedGraph< T,?> | graph,
|  | final T | rootNode,
|  | final HashMap< T, ITreeNode< T >> | mapping |
| ) |  |  | throws MalformedGraphException `[static]`

Parameters:

  | graph | The input graph.
  | rootNode | The root node of the graph.
  | mapping | Output parameter which will contain the mapping between API object and internal TreeType.

Returns:
  The generated dominator tree.

Exceptions:

  | MalformedGraphException |

static <TextendsIGraphNode<T> ArrayList<Set<T> > BinNavi.API.helpers.GraphAlgorithms.getGraphLoops | ( | final IDirectedGraph< T,?> | graph | ) | throws MalformedGraphException `[static]`

Calculates the loops contained in a graph.

Parameters:

  | graph | the input graph

Returns:
  A List of Sets where each set contains the nodes of one loop.

Exceptions:

  | MalformedGraphException | Thrown if the graph has more than one entry node.

static <NodeTypeextendsIGraphNode<NodeType> Set<NodeType> BinNavi.API.helpers.GraphAlgorithms.getLoopNodes | ( | final NodeType | srcNode,
|  | final NodeType | dstNode |
| ) |  |  | `[static]`

Gets the nodes of a loop

Parameters:

  | srcNode | The source node of the loop where the back edge originates from.
  | dstNode | The destination node of the loop where the back edge points to.

Returns:
  The Set of nodes which belong to the loop.

static <NodeTypeextendsIGraphNode<NodeType> Set<NodeType> BinNavi.API.helpers.GraphAlgorithms.getPredecessors | ( | final NodeType | node | ) | `[static]`

Returns all predecessors of a graph node.

Parameters:

  | node | The node which is the starting point of the predecessor search.

Returns:
  The predecessors of the node in the graph.

static <NodeTypeextendsIGraphNode<NodeType> Set<NodeType> BinNavi.API.helpers.GraphAlgorithms.getSuccessors | ( | final NodeType | node | ) | `[static]`

Returns all successors of a graph node.

Parameters:

  | node | The node which is the starting point of the successor search.

Returns:
  The successors of the node in the graph.