Graph
-
class Graph
Subclassed by WGraph< T >
Public Types
-
typedef int Weight
Public Functions
-
inline Graph()
-
inline Graph(const int vertexCount, const bool isDirected)
-
inline void reset(const int vertexCount, const bool isDirected)
-
inline bool isDirected() const
-
inline int vertexCount() const
-
inline int neighbourCount(const int vertex) const
-
inline int edgeCount() const
-
inline int neighbour(const int vertex, const int neighbourPos) const
Returns the id of the n-th neighbour of a vertex.
-
inline const std::vector<EdgeTo> &edgesToNeighbours(const int vertex) const
Returns the edges connected to a vertex.
-
inline std::vector<int> neighbours(const int vertex) const
Returns the neighbours of a vertex.
-
inline int weight(const int edgeId) const
Always returns 1 (the graph is not weighted)
-
inline int weight(const int vertex, const int neighbourPos) const
Always returns 1 (the graph is not weighted)
-
inline int edgeId(const int vertex, const int neighbourPos) const
Returns the id of the n-th out-edge of a vertex.
-
inline int edgeIdTo(const int vertex, const int neighbour)
Returns the id of the first edge from one vertex to another (-1 if it doesn’t exist)
-
inline void addEdge(const int vertex1, const int vertex2)
Creates a new edge between two vertices.
-
struct Edge
-
struct EdgeTo
-
typedef int Weight