I have an undirected simple graph in a .txt file formatted as an adjacency list like this:
100 200
200 300
300
400 500 600 700 800 900
...
Every number is a node id and the graph is unweighted. The first number in each row is that row's node and any following numbers are adjacent nodes. In this example node 100 has node 200 as its neighbor, node 200 has nodes 100 and 300 as its neighbors, and node 300 has node 200 as its neighbor.
I am trying to find the betweenness centrality of each node. I found out about the Input
, BetweennessCentrality
, and FromAdjacencyLists
functions but I cannot seem to use them correctly.
Does my data need to be formatted differently?
How do I get from inputing my data to using BetweennessCentrality
?
I don't know much about using Mathematica so I might be missing something obvious.