Jump to content

find path matrix of exact length.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
gammaman

gammaman

    Learning Programmer

  • Members
  • PipPipPip
  • 71 posts
I am confused as to exactly what is meant by "find path matrix of exact length n" where n is the number given. So say exactly length 2 for argument sake.

Now say I am given a 4 node digraph.

Posted Image

what would the path matrix of exactly length 2 be?

I know length 2 means R * R.

I know the path matrix is represented by a 2D array, in this case 4x4. But what does exactly length 2 mean.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
The path matrix shows the where each vertex can reach by crossing exactly 1 edge (path matrix of length 1). R*R shows where each vertex can reach by crossing exactly 2 edges in sequence (path matrix of length 2).
1-4 is length 1.
1-3-4 is length 2.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
gammaman

gammaman

    Learning Programmer

  • Members
  • PipPipPip
  • 71 posts
Ok, thanks. I also noticed it differs from warshall and floyd warshall algorithms in that you are not going through a specific node to another.

#4
tecktalk

tecktalk

    Programmer

  • Members
  • PipPipPipPip
  • 175 posts
Hmm its nice.. that the problem is solved now..
_________________________
guitar stores
lollipop lyrics