Exploring the dimensions

How many pair of nodes ( u , v ) (u,v) in the following graph are there such that the shortest path between u u and v v is length 2 2 ?

Details and Assumptions


The answer is 24.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Jeff Ifland
Oct 27, 2015

This adjacency matrix represents a cube. There are 6 unique paths that have a distance of 2 from any given node on this figure, however these paths can be paired up to trace out the 1 face of the cube, and thus both go to the same node. Thus there are 3 nodes that have a distance of two from any given node.

There are 8 nodes, so there are 8*3=24 such pairs.

Note: You will have the each pair of nodes represented twice: once as (a,b) and once as (b,a). So this problem is a little ambiguous in that it doesn't say ordered pairs of points, thus 12 could be argued as a correct answer as well.

Laurent Shorts
Apr 20, 2016

If A = ( a i j ) A=(a_{ij}) is the adjacency matrix, compute B = ( b i j ) = A 2 B=(b_{ij})=A^2 , which represents the number of paths of length 2 from vertex x i x_i to vertex x j x_j .

For each 1 i j 8 1\leq i\neq j\leq 8 , count 1 if a i j = 0 a_{ij}=0 and b i j > 0 b_{ij}>0 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...