First time here? Check out the FAQ!

Ask Your Question
0

code which counts the number of edges

asked 11 years ago

REKHA BISWAL gravatar image

How to write a code which counts the number of edges from a one vertex to another vertex in a directed bipartite graph?

Preview: (hide)

Comments

1

Do you mean the distance ?

vdelecroix gravatar imagevdelecroix ( 11 years ago )

yeah,you are right.

REKHA BISWAL gravatar imageREKHA BISWAL ( 11 years ago )

I don't know if I am right because in your question you specify that the graph "directed" and "bipartite"... what those two properties have to do with computing a distance in a graph ? Anyway, can you reformulate your question in a clearer way ?

vdelecroix gravatar imagevdelecroix ( 11 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 11 years ago

Jason Grout gravatar image

Following up on vdelecroix's comment above, here's an example:

sage: G=graphs.PathGraph(5)
sage: G.distance(2,4)
2
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 11 years ago

Seen: 412 times

Last updated: Apr 01 '13