1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sum of a path on a graph

Discussion in 'Mathematics' started by Wombles, Aug 2, 2020 at 2:25 AM.

  1. Wombles

    Wombles Guest

    I need to take my graph:

    g = Graph[{A \[UndirectedEdge] B, B \[UndirectedEdge] C,
    C \[UndirectedEdge] A, C \[UndirectedEdge] D,
    A \[UndirectedEdge] D, B \[UndirectedEdge] D},
    EdgeWeight -> {14, 46, 49, 48, 38, 16}, EdgeLabels -> "EdgeWeight",
    VertexLabels -> "Name"]


    and Find the sum of the weights along an arbitrary path, for example A->B->C->-D->A I've been trying to use GraphDistance but that only lets me go a single step. Does anyone know how to specify a path instead of just two vertices?

    Login To add answer/comment
     

Share This Page