| Conditions | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | from abc import ABCMeta, abstractmethod |
||
| 57 | def __init__(self, G, s): |
||
| 58 | self.s = s |
||
| 59 | vertex_count = G.vertex_count() |
||
| 60 | self.marked = [False] * vertex_count |
||
| 61 | self.edgeTo = [-1] * vertex_count |
||
| 62 | |||
| 63 | queue = Queue.create() |
||
| 64 | |||
| 65 | queue.enqueue(s) |
||
| 66 | while not queue.is_empty(): |
||
| 67 | v = queue.dequeue() |
||
| 68 | self.marked[v] = True |
||
| 69 | for w in G.adj(v): |
||
| 70 | if not self.marked[w]: |
||
| 71 | self.edgeTo[w] = v |
||
| 72 | queue.enqueue(w) |
||
| 73 | |||
| 84 | return path.iterate() |