There seem to be some misunderstandings here.
Graph
is not a function. It is a data structure representing a graph (network). The functions you want to use, such as BetweennessCentrality
, all work on this data structure. Thus you need to create a proper Graph
from a matrix.
You say that you want to analyse this network using AdjacencyGraph
. This is another misunderstanding. This function is not for analysis, or for computing any property. It is precisely the function that will take an adjacency matrix and will return a Graph
data structure.
Thus, we can do this:
Import the matrix:
In[1]:= matrix =
Rest /@ Import["~/Downloads/INDio.csv", HeaderLines -> 1];
In[2]:= Dimensions[matrix]
Out[2]= {56, 56}
Ad adjacency matrix must contain only zeros and ones. Thus we must unitize it:
am = Unitize[matrix]
Then you can create a Graph
from it:
g = AdjacencyGraph[am]
You can now use this graph in functions like BetweennessCentrality
If you need to add edge weights to the graph, then use WeightedAdjacencyGraph
. This function will treat Infinity
entries in the matrix as a missing connection, and all other entries as a connection with the given weight value. So we must replace all zero entries with Infinity
:
wam = Replace[matrix, zero_ /; zero == 0 -> Infinity, {2}]
Now you can create a weighted graph:
wg = WeightedAdjacencyGraph[wam]
You can check that it does indeed have edge weights:
PropertyValue[wg, EdgeWeight]
Some functions will make use of these weights, some won't. As I said in my first response, BetweennessCentrality
will not. It does make sense to compute betweenness centralities on weighted graphs, while taking the weights into account. But Mathematica cannot currently do this. The IGraph/M package can, however, I strongly suggest that you get familiar with Graph
s in Mathematica before you attempt to use the package.
Be sure to look up and understand the meanings of all these different centrality measures before computing them. Betweenness centrality is based on the concept of graph distance. When computing it on a weighted graph, "weights" will represent distance. Thus for betweenness calculation, large weight = weak connection, small weight = strong connection. If I understand your description, this is not the case in your data.
To get interpretable results, you must transform the weights in some meaningful way for each different kind of centrality that you compute.