GraphStream Users

Archives de la liste Aide


Right way to map data calculated by an algorithm


Chronologique Discussions 
  • From: "Kai Hainke" <kai_hainke AT freenet.de>
  • To: <users AT graphstream-project.org>
  • Subject: Right way to map data calculated by an algorithm
  • Date: Sun, 15 Jun 2014 18:54:58 +0200

I wonder about the recommended way to map data associated to the edges of a graph calculated by a dynamic algorithm. In the tutorial section the basic dynamic algorithm saves its data regarding to the edges in a HashMap<String, (DataType)>. But I wonder if it’s maybe better to save the data right at the edge with setAttribute(String key, Object ... values) in terms of performance.
Besides I wanted to implement an algorithm, which stores some values for the edges of a graph. These values only change at adding/deleting an edge. Thus I thought of a dynamic algorithm that extends SinkAdapter. And I thought of the initiation step just calling edgeAdded() for each existing edge, but I wonder about the computation step. Actually it would be blank then, and therefore I wondered if it would maybe be better to implement this not as an Algorithm but a special graph with a certain Attribute on the edges. But this would be not rly as comfortable as just using an algorithm and register any Graph there. Leaving compute() blank is maybe no problem, but I feel like this is suboptimal, maybe im missing something. Help is appreciated.



  • Right way to map data calculated by an algorithm, Kai Hainke, 15/06/2014

Archives gérées par MHonArc 2.6.16.

Top of page