Skip to content

Commit f84a0d4

Browse files
author
danghai
committed
reorganize graph
1 parent 3c4325a commit f84a0d4

17 files changed

+5
-4
lines changed

algorithms/graph/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .tarjan import *
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

graph/tarjan.py renamed to algorithms/graph/tarjan.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
in a graph.
44
https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm
55
"""
6-
from graph.graph import DirectedGraph
6+
from algorithms.graph.graph import DirectedGraph
77

88
class Tarjan(object):
99
def __init__(self, dict_graph):
@@ -54,4 +54,4 @@ def strongconnect(self, v, sccs):
5454
break
5555
scc.sort()
5656
sccs.append(scc)
57-
57+
File renamed without changes.

graph/__init__.py

Whitespace-only changes.

tests/test_graph.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from graph.tarjan import Tarjan
1+
from algorithms.graph import Tarjan
22

33
import unittest
44

@@ -41,4 +41,4 @@ def test_tarjan_example_2(self):
4141
}
4242

4343
g = Tarjan(example)
44-
self.assertEqual(g.sccs, [['A', 'B', 'E'], ['C', 'D'], ['F', 'G'], ['H']])
44+
self.assertEqual(g.sccs, [['A', 'B', 'E'], ['C', 'D'], ['F', 'G'], ['H']])

0 commit comments

Comments
 (0)