Fix graph edge references in Graph class
This commit is contained in:
parent
93a374d5b4
commit
0313592a7b
1 changed files with 2 additions and 2 deletions
|
|
@ -261,8 +261,8 @@ class Graph:
|
||||||
|
|
||||||
# Build graph and compute in-degrees
|
# Build graph and compute in-degrees
|
||||||
for edge in self.edges:
|
for edge in self.edges:
|
||||||
graph[edge.source].append(edge.target)
|
graph[edge.source_id].append(edge.target_id)
|
||||||
in_degree[edge.target] += 1
|
in_degree[edge.target_id] += 1
|
||||||
|
|
||||||
# Queue for vertices with no incoming edges
|
# Queue for vertices with no incoming edges
|
||||||
queue = deque(vertex for vertex in self.vertices if in_degree[vertex] == 0)
|
queue = deque(vertex for vertex in self.vertices if in_degree[vertex] == 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue