![]() |
Knight's Tour Generator
Tourneys and the Fast Generation and Obfuscation of Closed Knight's Tours
|
Undirected multi-graph. More...
#include <Graph.h>
Public Member Functions | |
CGraph (const UINT n) | |
Constructor. More... | |
~CGraph () | |
Destructor. More... | |
void | InsertEdge (const UINT i, const UINT j) |
Insert an edge. More... | |
UINT | BFSF (std::vector< UINT > &result) |
Breadth-first spanning forest. More... | |
void | PrintGraph () |
Print the graph to a text file. More... | |
Protected Attributes | |
std::vector< CEdge * > | m_vEdgeList |
Edge list. | |
UINT | m_nNumEdges = 0 |
Number of edges. | |
CVertex * | m_pVertexList = nullptr |
Vertex list. | |
UINT | m_nNumVerts = 0 |
Number of vertices. | |
std::queue< CVertex * > | m_qBFSQueue |
Queue for breadth-first search. | |
CRandom | m_cRandom |
Random number generator. | |
A multi-graph stored as a list of edges and an incidence list that consists of a list of indices into the edge list for each vertex consisting of the indices of the edges incident with it. The term multi-graph means that there can be multiple edges between two vertices.
CGraph::CGraph | ( | const UINT | n | ) |
CGraph::~CGraph | ( | ) |
Insert an edge between two vertices by appending an instance of CEdge at the end of the edge list and appending the index of that edge (which is the size of the edge list before insertion) to the incidence lists of the vertices. Self-edges and vertices out of range are ignored.
i | The vertex at one end of the edge to be inserted. |
j | The vertex at the other end of the edge to be inserted. |