Skip to content

Commit a786315

Browse files
author
Toto Lin
authored
Merge pull request #34 from WAAutoMaton/master
add ``Edge.unweighted_edge``
2 parents a10bcb9 + ed595d5 commit a786315

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cyaron/graph.py

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ def __str__(self):
2121
"""
2222
return "%d %d %d" % (self.start, self.end, self.weight)
2323

24+
@staticmethod
25+
def unweighted_edge(edge):
26+
"""unweighted_edge(edge) -> str
27+
Return a string to output the edge without weight. The string contains the start vertex, end vertex(u,v) and splits with space.
28+
"""
29+
return '%d %d'%(edge.start,edge.end)
2430

2531
class Graph:
2632
"""Class Graph: A class of the graph

0 commit comments

Comments
 (0)