Tells you in constant time if two nodes are adjacent. More...
#include <ogdf/basic/AdjacencyOracle.h>
Public Member Functions | |
| AdjacencyOracle (const Graph &G) | |
| The constructor for the class, needs time O(n + m) More... | |
| ~AdjacencyOracle () | |
| The destructor. More... | |
| bool | adjacent (const node, const node) const |
| Returns true iff two vertices are adjacent. More... | |
Private Attributes | |
| Array2D< bool > | m_adjacencyMatrix |
| A 2D-array where the entry is true if the nodes with the corresponding number are adjacent. More... | |
| NodeArray< int > | m_nodeNum |
| The internal number given to each node. More... | |
Tells you in constant time if two nodes are adjacent.
AdjacencyOracle is initialized with a Graph and returns for any pair of nodes in constant time if they are adajcent.
Definition at line 46 of file AdjacencyOracle.h.
|
explicit |
The constructor for the class, needs time O(n + m)
Builds a 2D-array indexed by the numbers of vertices.
It uses only the part of the matrix left of the diagonal (where the first index is smaller than the second. For each pair of vertices, the corresponding entry in the matrix is set true if and only if the two vertices are adjacent.
|
inline |
The destructor.
Definition at line 61 of file AdjacencyOracle.h.
Returns true iff two vertices are adjacent.
|
private |
A 2D-array where the entry is true if the nodes with the corresponding number are adjacent.
Definition at line 68 of file AdjacencyOracle.h.
|
private |
The internal number given to each node.
Definition at line 67 of file AdjacencyOracle.h.