The Graph class represents a graph data structure.
#include <avogadro/core/graph.h>
◆ Graph() [1/2]
Creates a new, empty graph.
◆ Graph() [2/2]
Creates a new graph containing size n
vertices.
◆ ~Graph()
◆ setSize()
Sets the number of verticies in the graph to size n
.
◆ size()
- Returns
- the number of verticies in the graph.
◆ isEmpty()
- Returns
true
if the graph is empty (i.e. size() == 0
).
◆ clear()
Removes all verticies and edges from the graph.
◆ addVertex()
Adds a vertex to the graph and returns its index.
◆ removeVertex()
void removeVertex |
( |
size_t |
index | ) |
|
Removes the vertex at index
from the graph.
◆ vertexCount()
size_t vertexCount |
( |
| ) |
const |
- Returns
- the number of verticies in the graph.
◆ addEdge()
void addEdge |
( |
size_t |
a, |
|
|
size_t |
b |
|
) |
| |
Adds an edge between verticies a
and b
.
◆ removeEdge()
void removeEdge |
( |
size_t |
a, |
|
|
size_t |
b |
|
) |
| |
Removes the edge between veritices a
and b
.
◆ removeEdges() [1/2]
Removes all of the edges from the graph.
◆ removeEdges() [2/2]
void removeEdges |
( |
size_t |
index | ) |
|
Removes all of the edges that contain the vertex at index
from the graph.
◆ edgeCount()
size_t edgeCount |
( |
| ) |
const |
- Returns
- the number of edges in the graph.
◆ neighbors()
const std::vector< size_t > & neighbors |
( |
size_t |
index | ) |
const |
- Returns
- a vector containing the indicies of each vertex that the vertex at index shares an edge with.
◆ degree()
size_t degree |
( |
size_t |
index | ) |
const |
- Returns
- the degree of the vertex at
index
.
◆ containsEdge()
bool containsEdge |
( |
size_t |
a, |
|
|
size_t |
b |
|
) |
| const |
- Returns
true
if the graph contains an edge between verticies a
and b
.
◆ connectedComponents()
std::vector< std::set< size_t > > connectedComponents |
( |
| ) |
const |
- Returns
- a vector of vector containing the indicies of each vertex in each connected component in the graph.
◆ connectedComponent()
std::set< size_t > connectedComponent |
( |
size_t |
index | ) |
const |
- Returns
- a set containing the indicies of each vertex connected with
index
.
◆ subgraphsCount()
size_t subgraphsCount |
( |
| ) |
const |
- Returns
- the number of connected subgraphs.
◆ subgraph()
size_t subgraph |
( |
size_t |
index | ) |
const |
- Returns
- the subgraphs ID from the
index
.
◆ subgraphCount()
size_t subgraphCount |
( |
size_t |
index | ) |
const |
- Returns
- the group size from the
index
.
◆ getConnectedID()
size_t getConnectedID |
( |
size_t |
index | ) |
const |
The documentation for this class was generated from the following file: