46 return fullGraph.
rings;
79 for (
int iatom = 0; iatom < neighHbondList.size(); iatom++) {
117 int maxDepth,
int depth,
int root) {
125 fullGraph->
pts[v].inGraph =
false;
129 if (depth >= maxDepth) {
147 nnumNeighbours = fullGraph->
pts[v].neighListIndex.size();
149 for (
int j = 0; j < nnumNeighbours; j++) {
150 n = fullGraph->
pts[v].neighListIndex[j];
152 if (depth > 2 && n == root) {
157 else if (fullGraph->
pts[n].inGraph) {
158 fullGraph->
pts[n].inGraph =
false;
161 fullGraph->
pts[n].inGraph =
true;
168 for (
int j = 0; j < fullGraph->
pts[v].neighListIndex.size(); j++) {
169 if (root == fullGraph->
pts[v].neighListIndex[j]) {
170 fullGraph->
pts[v].neighListIndex.erase(
171 fullGraph->
pts[v].neighListIndex.begin() + j);
177 (*visited).pop_back();
204 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
208 nnumNeighbours = neighHbondList[iatom].size() -
210 for (
int j = 1; j <= nnumNeighbours; j++) {
211 jatomID = neighHbondList[iatom][j];
213 auto it = yCloud->idIndexMap.find(jatomID);
214 if (it != yCloud->idIndexMap.end()) {
215 jatomIndex = it->second;
229 fullGraph.
pts.push_back(iVertex);
256 for (
int i = 0; i < nList.size(); i++) {
264 fullGraph.
pts.push_back(iVertex);
288 for (
int i = 0; i < nList.size(); i++) {
291 fullGraph->
pts[i].neighListIndex = nList[i];
309 int nVertices = fullGraph->
pts.size();
329 for (
int iVer = 0; iVer < nVertices; iVer++) {
330 fullGraph->
pts[iVer].inGraph =
true;
334 for (
int iRing = 0; iRing < nRings; iRing++) {
335 currentRing = fullGraph->
rings[iRing];
336 ringSize = currentRing.
size();
339 for (
int jVer = 0; jVer < ringSize; jVer++) {
342 for (
int kVer = jVer + 2; kVer < ringSize; kVer++) {
345 currentV = currentRing[jVer];
346 currentN = currentRing[kVer];
347 d_jk = std::abs(jVer - kVer);
348 dist_r =
std::min(d_jk, std::abs(d_jk - ringSize)) +
354 &visited, dist_r, 0);
355 dist_g = path.
size();
356 if (dist_g < dist_r) {
367 for (
int i = 0; i < ringsToRemove.
size(); i++) {
368 if (!ringsToRemove[i]) {
375 fullGraph->
rings = primitiveRings;
399 int maxDepth,
int depth) {
404 if (depth < maxDepth) {
406 (*visited).push_back(
410 len_path = (*path).size();
412 if (depth < len_path || len_path == 0) {
413 (*path) = (*visited);
419 nnumNeighbours = fullGraph->
pts[v].neighListIndex.size();
421 for (
int j = 0; j < nnumNeighbours; j++) {
422 n = fullGraph->
pts[v].neighListIndex[j];
424 if (fullGraph->
pts[n].inGraph ==
true) {
425 fullGraph->
pts[n].inGraph =
false;
428 fullGraph->
pts[n].inGraph =
true;
434 (*visited).pop_back();
448 tempPts.
swap(currentGraph->
pts);
450 return *currentGraph;
File for generating shortest-path rings according to the Franzblau algorithm.
Graph restoreEdgesFromIndices(Graph *fullGraph, std::vector< std::vector< int >> nList)
Graph populateGraphFromNListID(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> neighHbondList)
Graph countAllRingsFromIndex(std::vector< std::vector< int >> neighHbondList, int maxDepth)
Creates a vector of vectors of all possible rings.
Graph populateGraphFromIndices(std::vector< std::vector< int >> nList)
Graph removeNonSPrings(Graph *fullGraph)
Removes the non-SP rings, using the Franzblau shortest path criterion.
std::vector< std::vector< int > > ringNetwork(std::vector< std::vector< int >> nList, int maxDepth)
std::vector< int > neighListIndex
This is the index according to pointCloud.
std::vector< std::vector< int > > rings
Graph clearGraph(Graph *currentGraph)
Function for clearing vectors in Graph after multiple usage.
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.
int findRings(Graph *fullGraph, int v, std::vector< int > *visited, int maxDepth, int depth, int root=-1)
Main function that searches for all rings.
std::vector< Vertex > pts
This contains a collection of points; contains information for a particular frame.
This contains per-particle information.
This is a per-frame object, containing all the vertices for the particular frame, along with the vect...
This is a collection of elements, for each point, required for graph traversal.