Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Find two adjacent nodes og a graph' topicStudent Support Forum > General > "Find two adjacent nodes og a graph"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Peter Pein
09/19/12 2:12pm

Hi,
I think, AdjacencyMatrix will do that. For example:

g = HypercubeGraph[3];
MatrixForm[am = AdjacencyMatrix[g]]

hth,
Peter

P.S.: am is a sparse array, so you'll have to throw a "Normal", when doing sth. like

Position[am[[5]] // Normal, 1][[All, 1]]

URL: ,

Subject (listing for 'Find two adjacent nodes og a graph')
Author Date Posted
Find two adjacent nodes og a graph Marco 09/17/12 5:26pm
Re: Find two adjacent nodes og a graph Bill Simpson 09/18/12 8:54pm
Re: Find two adjacent nodes og a graph Peter Pein 09/19/12 2:12pm
< Previous CommentHelp | Reply To Comment | Reply To Topic