Knight's Tour Generator
Tourneys and the Fast Generation and Obfuscation of Closed Knight's Tours
Public Member Functions | Private Attributes | List of all members
CVertex Class Reference

Graph vertex. More...

#include <Graph.h>

Public Member Functions

 CVertex ()
 Constructor.
 
void InsertAdjacency (CEdge *pEdge)
 Add an edge to the edge list. More...
 
void SetIndex (const UINT n)
 Set index. More...
 
UINT GetIndex ()
 Get index;. More...
 
void Mark (bool b=true)
 Mark or unmark. More...
 
bool Marked ()
 Get mark. More...
 
std::vector< CEdge * > * GetAdjacencyList ()
 Get adjacency list. More...
 
size_t GetDegree ()
 Get degree. More...
 

Private Attributes

std::vector< CEdge * > m_vAdjacencyList
 Adjacency list.
 
UINT m_nIndex = 0
 Index into vertex list.
 
bool m_bMarked = false
 Mark flag.
 

Detailed Description

A vertex consists of an adjacency list, an index into the vertex list and a flag that indicates whether the vertex is marked or not.

Definition at line 70 of file Graph.h.

Member Function Documentation

◆ GetAdjacencyList()

std::vector< CEdge * > * CVertex::GetAdjacencyList ( )

Get a pointer to the adjacency list.

Returns
A pointer to the adjacency list.

Definition at line 128 of file Graph.cpp.

◆ GetDegree()

size_t CVertex::GetDegree ( )

Get the degree, that is, the number of adjacent vertices.

Returns
The degree.

Definition at line 135 of file Graph.cpp.

◆ GetIndex()

UINT CVertex::GetIndex ( )

Reader function for the index.

Returns
The index of this vertex in the vertex vertex.

Definition at line 107 of file Graph.cpp.

◆ InsertAdjacency()

void CVertex::InsertAdjacency ( CEdge pEdge)

Add an edge to the edge list.

Parameters
pEdgePointer to an edge.

Definition at line 92 of file Graph.cpp.

◆ Mark()

void CVertex::Mark ( bool  b = true)

Set or unset the mark flag.

Parameters
btrue to set mark flag (default), false to unset it

Definition at line 114 of file Graph.cpp.

◆ Marked()

bool CVertex::Marked ( )

Reader function for the mark flag.

Returns
true if marked, false if unmarked.

Definition at line 121 of file Graph.cpp.

◆ SetIndex()

void CVertex::SetIndex ( const UINT  n)

Set index.

Parameters
nThe index of this vertex in the vertex list.

Definition at line 100 of file Graph.cpp.