Ask Your Question
0

code which counts the number of edges

asked 2013-03-28 14:20:38 +0100

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?

edit retag flag offensive close merge delete

Comments

1

Do you mean the distance ?

vdelecroix gravatar imagevdelecroix ( 2013-03-28 15:54:04 +0100 )edit

yeah,you are right.

REKHA BISWAL gravatar imageREKHA BISWAL ( 2013-03-29 02:09:38 +0100 )edit

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 ( 2013-03-29 05:36:41 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-04-01 06:23:49 +0100

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
edit flag offensive delete link more

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: 2013-03-28 14:20:38 +0100

Seen: 393 times

Last updated: Apr 01 '13