Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::AdjacencyOracle Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AdjacencyOracle()

ogdf::AdjacencyOracle::AdjacencyOracle ( const Graph &  G)
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.

◆ ~AdjacencyOracle()

ogdf::AdjacencyOracle::~AdjacencyOracle ( )
inline

The destructor.

Definition at line 61 of file AdjacencyOracle.h.

Member Function Documentation

◆ adjacent()

bool ogdf::AdjacencyOracle::adjacent ( const node  ,
const node   
) const

Returns true iff two vertices are adjacent.

Member Data Documentation

◆ m_adjacencyMatrix

Array2D<bool> ogdf::AdjacencyOracle::m_adjacencyMatrix
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.

◆ m_nodeNum

NodeArray<int> ogdf::AdjacencyOracle::m_nodeNum
private

The internal number given to each node.

Definition at line 67 of file AdjacencyOracle.h.


The documentation for this class was generated from the following file: