private void DeactivateVertex(int prevVertex, int vertex) { ActiveVerticesCount--; VerticesStates[vertex] = VertexState.visited; PrevVertices.Pop(); if (SaveSteps) { AddDeactivateVertexStep(prevVertex, vertex); } }
private void DeactivateEdge(int from, int to) { if (from != -1) { EdgesActive[from, to] = false; if (!Oriented) { EdgesActive[to, from] = false; } ActiveEdgesCount--; PrevVertices.Pop(); } if (SaveSteps) { AddDeactivateEdgeStep(from, to); } }
private void DFC(int prevVertex, int curVertex) { VerticesStates[curVertex] = VertexState.active; PrevVertices.Push(curVertex); if (SaveSteps) { AddActivationStep(prevVertex, curVertex); } for (int i = 0; i < VerticesCount; i++) { CheckConnectedVertex(prevVertex, curVertex, i); } VerticesStates[curVertex] = VertexState.visited; PrevVertices.Pop(); if (SaveSteps) { AddLeavingStep(curVertex, prevVertex); } }