a struct to represent edges
class edge : NEW_LINE INDENT def __init__ ( self , u , w ) : NEW_LINE INDENT self . From = u NEW_LINE self . weight = w NEW_LINE DEDENT DEDENT def addedge ( u , v , w ) : NEW_LINE INDENT edges [ v ] . append ( edge ( u , w ) ) NEW_LINE DEDENT