ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 01 Apr 2013 06:23:49 +0200code 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 14:20:38 +0100https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/Comment 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 15:54:04 +0100https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?comment=18003#post-id-18003Comment 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 ?Fri, 29 Mar 2013 05:36:41 +0100https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?comment=17999#post-id-17999Comment 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.Fri, 29 Mar 2013 02:09:38 +0100https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?comment=18000#post-id-18000Answer 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)
2Mon, 01 Apr 2013 06:23:49 +0200https://ask.sagemath.org/question/9952/code-which-counts-the-number-of-edges/?answer=12046#post-id-12046