Fraxinus
18.10
An IGT application
|
#include <adjlist.hpp>
Public Member Functions | |
AdjList (int nodes) | |
void | adjacent (int n1, int n2) |
void | visit (int node) |
bool | isVisited (int node) const |
int | findNext (int node) const |
vector< int > | findAllNext (int node) const |
int | findFirst () const |
vector< int > | findAllFirst () const |
void | print () |
Class representing an adjacency list, with the possibility of marking a node as visited
Definition at line 11 of file adjlist.hpp.
|
inline |
Constructor. Initialize an adjacency list and initialize all nodes to unvisited with no neighbours
nodes | Number of nodes in graph |
Definition at line 27 of file adjlist.hpp.
|
inline |
Mark two nodes as adjacent to each other (undirected)
n1 | Node 1 |
n2 | Node 2 |
Definition at line 45 of file adjlist.hpp.
|
inline |
Find all nodes with only one neighbour
Definition at line 129 of file adjlist.hpp.
|
inline |
Find all adjacent nodes that has not been visited yet
node | to find all unvisited adjacent nodes for |
Definition at line 94 of file adjlist.hpp.
|
inline |
Find the first node that has only 1 neighbour
Definition at line 113 of file adjlist.hpp.
|
inline |
Find an adjacent node that has not been visited or found yet
node | Node to find unvisited adjacent node for |
Definition at line 77 of file adjlist.hpp.
|
inline |
Check if node is visited
node | node to check if visited |
Definition at line 67 of file adjlist.hpp.
|
inline |
Print the adjacency list
Definition at line 145 of file adjlist.hpp.
|
inline |
Mark a node as visited
node | Node to mark as visited |
Definition at line 56 of file adjlist.hpp.