Algorithms_in_C++
1.0.0
Set of algorithms implemented in C++.
|
Public Member Functions | |
Graph (size_t N, const std::vector< std::pair< int, int > > &undirected_edges) | |
Populate the adjacency list for each vertex in the graph. Assumes that evey edge is a pair of valid vertex indices. More... | |
int | number_of_vertices () const |
Public Attributes | |
std::vector< std::vector< int > > | neighbors |
for each vertex it stores a list indicies of its neighbors | |
Class for representing a graph as an adjacency list. Its vertices are indexed 0, 1, ..., N - 1.
|
inline |
Populate the adjacency list for each vertex in the graph. Assumes that evey edge is a pair of valid vertex indices.
N | number of vertices in the graph |
undirected_edges | list of graph's undirected edges |
|
inline |