Skip to content

Possiblity of having a graph weighted in two ways? #26

@ghost

Description

Hi there!

To create a weighted graph we should issue this command: g = SimpleWeightedGraph(sources, destinations, weights). In addition to distance between edges, I want to asign their time also. That is, having a graph that its weight are both distance and time. I only want to do so, because at some point I need to query the time of some edges, and if I on;y construct the graph based on the distances, I cannot find out the time of a specific edge.

So, three questions:
1- Is is possible to have two ways of assigning weights to a graph?
2- Is there any better way?
3- How to iterate ove edges? I did for (i,j) in edges(g) and it did not work, which kind of make sense to me, but I don't know how to iterate.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions