Jun 30, 2010 at 7:49 PM
Edited Jun 30, 2010 at 8:41 PM

Hey, I was trying to find out if there is a way in NodeXL API which generates a weighted graph( giving weights to the edges). That is when file containing only (vertex1 Vertex2) info loaded into the NodeXL API , API generates a weighted undirected or weighted
directed graph from it. Though I see from the standalone application that we ca get degree, indegree , out degree etc. Can we get weights for the edges as well. I mean some methods in API to be called to get the edge weights,indegree, outdegree. Thanks
for the help in advance.


Jun 30, 2010 at 10:03 PM
Edited Jun 30, 2010 at 10:04 PM

There is no lowlevel NodeXL API call to merge duplicate edges and assign weights to the edges. (I assume that's what you're asking for; correct me if I'm wrong.) There
is code in the NodeXL Excel Template to do this, but because that code operates on a worksheet and not on a graph, it is not available to other applications.
There are lowlevel NodeXL API calls to get indegree and outdegree. Do you want to know how to use them? I'm not sure if that's part of your question.
 Tony



ya Tony, that what I wanted to know. I mean how can I get indegree,outdegree and weights. Like say there is node A and B and say there is edge whose weight is 3. Now by making some calls to some method in API which gives me weight, indegree,outdegree.
Also how can we apply filters on edge's weights etc in program. Thanks Tony for your help



"Edge weight" does not have a specific definition. It is just a number that someone has assigned to each edge, and the meaning of the numbers varies from graph to graph. When you say you have an edge whose weight is 3, then you already
know the edge weight, and you don't need NodeXL to calculate it for you. And in fact NodeXL can't calculate it for you, because the lowerlevel NodeXL layers know nothing about edge weights. (As I mentioned earlier, the highlevel Node Excel Template
does assign edge weights when it merges duplicate edges, where the edge weight is the number of duplicate edges that were merged into one, but that definition of edge weight is specific to the Template, and other applications may define edge weight in a completely
different manner.)
We can help you with degree, however. To calculate the degrees of a graph's vertices, use the Microsoft.NodeXL.Algorithms.VertexDegreeCalculator class. There are several ways to use the class, but the simplest is to call the CalculateGraphMetrics()
method. This takes an IGraph as an argument and returns a Dictionary<> of VertexDegrees objects, one for each of the graph's vertices. Please see the
VertexDegreeCalculator Class topic in the NodeXLApi.chm help file for more details.
 Tony



Hi
I have an excel sheet containing node 1 and 2 information (i.e their names) in columns 1 and 2 and column 3 has the edge weight. Is there a way to generate a network having edge weights? I would like to be able to import the resultant edge weighted network
to Cytoscape to do calculations of network parameters.
Thanks for the help, in advance



Hello!
Thank you for the interest in NodeXL.
If you have an edge list (Vertex 1, Vertex 2, Edge Weight) then you can probably import directly into Cytoscape  NodeXL would not add much to the process.
However, you can calculate network metrics in NodeXL as well. So perhaps you can paste your data into the NodeXL edges worksheet and then calculate metrics and layout and visualize the network.
You can display edge weights in NodeXL by mapping an edge data attribute to the Edge Width display attribute via the NodeXL>Visual Properties>Autofill Columns>Edges>Edge Width>[Select the edge weight column you prefer].
Regards,
Marc



Hi
That is the issue. Cytoscape doesn't support weighted edge.
Suchetana



Understood.
In that case, you may find that NodeXL is able to perform the operations you require.
You might consider uploading your graph to NodeXL Graph Gallery if you would like others to access and possibly refine your network visualization.
Regards,
Marc




