# code which counts the number of edges

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

code which counts the number of edges

1

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

```
sage: G=graphs.PathGraph(5)
sage: G.distance(2,4)
2
```

Asked: **
2013-03-28 08:20:38 -0600
**

Seen: **114 times**

Last updated: **Mar 31 '13**

Iterate over acyclic subdigraphs

How to make pygraphviz and sage compatible?

.plot() displaying cycle graphs as huge pretzels

digraph.diameter() returning +Infinity for some cases

How to get an arbitrary orientation of a graph.

Orientation of poset plot in Sage 6.3 vs 6.4

edge_style for different edges in a multigraph

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.

Do you mean the distance ?

yeah,you are right.

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 ?