How to get Average and Maximum Edge Weight.
-
- Posts:51
- Joined:12 Oct 2011 23:01
- Location:Arkansas,USA [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
I need to get the average edge weight of the graph. Also, I need the maximum edge weight of the graph. I would be glad if anyone could help me with that.
-
- Gephi Community Manager
- Posts:964
- Joined:09 Dec 2009 14:41 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: How to get Average and Maximum Edge Weight.
Data Laboratory > Edge Table > click on the weight column to sort.
To get the average, you need to export this table as a spreadsheet, and use another tool to compute it.
To get the average, you need to export this table as a spreadsheet, and use another tool to compute it.
-
- Posts:51
- Joined:12 Oct 2011 23:01
- Location:Arkansas,USA [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: How to get Average and Maximum Edge Weight.
This is nice answer. However, what I need to do is to get those in run time. In other words, I need to know how to get them in source code.
I have the variable hgraph and for example I can get the number of the edges in the graph by using hgraph.getEdgeCount(). But as you know, I am trying to get the average and maximum values of the edge weights programmatically and I don't know how to do it.
I have the variable hgraph and for example I can get the number of the edges in the graph by using hgraph.getEdgeCount(). But as you know, I am trying to get the average and maximum values of the edge weights programmatically and I don't know how to do it.
-
- Gephi Community Manager
- Posts:964
- Joined:09 Dec 2009 14:41 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: How to get Average and Maximum Edge Weight.
So you need to iterate over each edge with:
Code: Select all
for (Edge e : graph.getEdges()) {
... e.getWeight();
}