WOLFRAM NOTEBOOK

In[]:=
ShortestPathsVertices[graph_,v1_,v2_]:=VertexList[graph]Position[MapThread[Plus,{GraphDistance[graph,v1],GraphDistance[graph,v2]}],GraphDistance[graph,v1,v2]]All,1
In[]:=
GeodesicsAll[g_Graph,vpairs:{{_,_}..}]:=HighlightGraph[g,ShortestPathsVertices[g,##]&@@@vpairs]
In[]:=
HighlightGraph[graph,ShortestPathsVertices[graph,57,332]]
Out[]=
In[]:=
GeodesicsAll[graph,{{57,332},{2,63}}]
Out[]=
In[]:=
GeodesicsAll[sph,{{1,600},{200,300}}]
Out[]=
Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.