primitive Namespace Reference

Functions for generating primitive rings. This namespace contains struct definitions and functions that are used for generating primitive (shortest-path) rings (directed cyclic graphs). More...

Data Structures

struct  Vertex
 This is a collection of elements, for each point, required for graph traversal. More...
 
struct  Graph
 This is a per-frame object, containing all the vertices for the particular frame, along with the vector of rings generated. More...
 

Functions

std::vector< std::vector< int > > ringNetwork (std::vector< std::vector< int >> nList, int maxDepth)
 
Graph populateGraphFromNListID (molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> neighHbondList)
 
Graph populateGraphFromIndices (std::vector< std::vector< int >> nList)
 
Graph restoreEdgesFromIndices (Graph *fullGraph, std::vector< std::vector< int >> nList)
 
Graph countAllRingsFromIndex (std::vector< std::vector< int >> neighHbondList, int maxDepth)
 Creates a vector of vectors of all possible rings. More...
 
Graph removeNonSPrings (Graph *fullGraph)
 Removes the non-SP rings, using the Franzblau shortest path criterion. More...
 
int findRings (Graph *fullGraph, int v, std::vector< int > *visited, int maxDepth, int depth, int root=-1)
 Main function that searches for all rings. More...
 
int shortestPath (Graph *fullGraph, int v, int goal, std::vector< int > *path, std::vector< int > *visited, int maxDepth, int depth=1)
 Calculates the shortest path. More...
 
Graph clearGraph (Graph *currentGraph)
 Function for clearing vectors in Graph after multiple usage. More...
 

Detailed Description

Functions for generating primitive rings. This namespace contains struct definitions and functions that are used for generating primitive (shortest-path) rings (directed cyclic graphs).

The Vertex object is a collection of elements for each point, required for graph traversal. The Graph object is an object for the whole frame, containing the information of all vertices, and a row-ordered vector of vector of the rings generated.

The Franzblau shortest-path criterion has been used. The SP (shortest-path) criterion is midway between the least restrictive and most restrictive criteria in the hierarchy.

The following is the procedure for finding primitive rings:

  1. All possible rings (including non-SP) rings are found, in the primitive::countAllRingsFromIndex function, using the backtracking algorithm. This is a recursive algorithm.
  2. The non-SP rings are then removed from the list of all rings, using the Franzblau shortest path criterion (primitive::removeNonSPrings). This also uses recursion.

Changelog