Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1dd480b

Browse files
committedMay 11, 2018
Add Tarjan's algorithm.
1 parent 25703c3 commit 1dd480b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎src/algorithms/graph/articulation-points/articulationPoints.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ export default function articulationPoints(graph) {
3838
* @param {GraphVertex} previousVertex
3939
*/
4040
enterVertex: ({ currentVertex, previousVertex }) => {
41+
// Tick discovery time.
42+
discoveryTime += 1;
43+
4144
// Put current vertex to visited set.
4245
visitedSet[currentVertex.getKey()] = new VisitMetadata({
4346
discoveryTime,
4447
lowDiscoveryTime: discoveryTime,
4548
});
4649

47-
// Tick discovery time.
48-
discoveryTime += 1;
49-
5050
if (previousVertex) {
5151
// Update children counter for previous vertex.
5252
visitedSet[previousVertex.getKey()].independantChildrenCount += 1;

‎src/algorithms/graph/bridges/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ An undirected connected graph with no cut edges
2121

2222
## References
2323

24+
- [GeeksForGeeks on YouTube](https://www.youtube.com/watch?time_continue=110&v=thLQYBlz2DM)
2425
- [Wikipedia](https://en.wikipedia.org/wiki/Bridge_%28graph_theory%29#Tarjan.27s_Bridge-finding_algorithm)
2526
- [GeeksForGeeks](https://www.geeksforgeeks.org/bridge-in-a-graph/)
26-
- [GeeksForGeeks on YouTube](https://www.youtube.com/watch?time_continue=110&v=thLQYBlz2DM)

0 commit comments

Comments
 (0)
Please sign in to comment.