ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 31 Mar 2013 23:23:49 -0500code which counts the number of edgeshttps://ask.sagemath.org/question/9952/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?Thu, 28 Mar 2013 08:20:38 -0500https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/Comment by REKHA BISWAL for <p>How to write a code which counts the number of edges from a one vertex to another vertex in a directed bipartite graph?</p>
https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?comment=18000#post-id-18000yeah,you are right.Thu, 28 Mar 2013 20:09:38 -0500https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?comment=18000#post-id-18000Comment by vdelecroix for <p>How to write a code which counts the number of edges from a one vertex to another vertex in a directed bipartite graph?</p>
https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?comment=17999#post-id-17999I 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 ?Thu, 28 Mar 2013 23:36:41 -0500https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?comment=17999#post-id-17999Comment by vdelecroix for <p>How to write a code which counts the number of edges from a one vertex to another vertex in a directed bipartite graph?</p>
https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?comment=18003#post-id-18003Do you mean the distance ?Thu, 28 Mar 2013 09:54:04 -0500https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?comment=18003#post-id-18003Answer by Jason Grout for <p>How to write a code which counts the number of edges from a one vertex to another vertex in a directed bipartite graph?</p>
https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?answer=12046#post-id-12046Following up on vdelecroix's comment above, here's an example:
sage: G=graphs.PathGraph(5)
sage: G.distance(2,4)
2Sun, 31 Mar 2013 23:23:49 -0500https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?answer=12046#post-id-12046