Question: A question in graph theory based program

Given a Graph say G with its adjacency matrix say. 

Consider a edge uv in the graph say 

how to find the number of vertices of 

Case1 : The number of vertices of graph G whose distance to the vertex v is smaller than the distance to the vertex u.

Case 2:  The  number of vertices of graph G whose distance to the vertex u
is smaller than the distance to the vertex v.

To u is adjacent to V that is uv is a edge here. 

Please Wait...