Skip to content

Commit

Permalink
Merge pull request #34 from WAAutoMaton/master
Browse files Browse the repository at this point in the history
add ``Edge.unweighted_edge``
  • Loading branch information
Toto Lin authored Jan 15, 2018
2 parents a10bcb9 + ed595d5 commit a786315
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cyaron/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ def __str__(self):
"""
return "%d %d %d" % (self.start, self.end, self.weight)

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

class Graph:
"""Class Graph: A class of the graph
Expand Down

0 comments on commit a786315

Please sign in to comment.