Write a Mathematica command that takes a weight matrix of a graph, and a list of vertices

Question:

Write a Mathematica command that takes a weight matrix of a graph, and a list of vertices forming a path in the graph, and returns the weight of the path.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: