Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'matrices: general help needed' topicStudent Support Forum > General > Archives > "matrices: general help needed"

Next Comment >Help | Reply To Topic
Author Comment/Response
Tom Moliterno
09/10/02 5:07pm

I need to create an adjaceny matrix from my data, which is currently in the form of a .txt file and is basically a two column incidence list. For example:

1 A
1 B
2 B
3 C
. .
. .
. .
m n

Where 1-m represent actors and A-n represent events. My goal is to have an (m x m) matrix where cell i,j equals 1 if two actors are incident to the same event and 0 otherwise (w/ zeros on the diagonal).

I'm new to Mathmatica, and so I'm on the steep part of the learning curve ... All I've been able to figure out so far is how to get my incidence list into the program using Import["filename.txt"]. But then what? How do I convert to the adjacency matrix? I've found the ToAdjacencyMatrix[] command in DiscreteMath`Combinatorica`, but I can't seem to get it to work ...

Thanks to any and all in advance.

Tom

URL: ,

Subject (listing for 'matrices: general help needed')
Author Date Posted
matrices: general help needed Tom Moliterno 09/10/02 5:07pm
Re: matrices: general help needed Forum Modera... 09/16/02 12:05pm
Next Comment >Help | Reply To Topic