jgrapht-users Mailing List for JGraphT (Page 36)
Brought to you by:
barak_naveh,
perfecthash
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(2) |
2005 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(1) |
May
|
Jun
(12) |
Jul
(6) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
(1) |
Dec
|
2006 |
Jan
(4) |
Feb
(3) |
Mar
(2) |
Apr
(3) |
May
(6) |
Jun
(2) |
Jul
(3) |
Aug
(12) |
Sep
(6) |
Oct
(3) |
Nov
(12) |
Dec
|
2007 |
Jan
(6) |
Feb
|
Mar
(6) |
Apr
(8) |
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(3) |
Sep
(7) |
Oct
(3) |
Nov
|
Dec
(1) |
2008 |
Jan
(11) |
Feb
(4) |
Mar
(8) |
Apr
(3) |
May
(4) |
Jun
(1) |
Jul
|
Aug
(3) |
Sep
(1) |
Oct
(4) |
Nov
(5) |
Dec
(5) |
2009 |
Jan
(3) |
Feb
(12) |
Mar
(14) |
Apr
(9) |
May
(8) |
Jun
(1) |
Jul
(4) |
Aug
(10) |
Sep
|
Oct
(10) |
Nov
|
Dec
(4) |
2010 |
Jan
(9) |
Feb
(16) |
Mar
(14) |
Apr
(19) |
May
(1) |
Jun
(3) |
Jul
(17) |
Aug
(9) |
Sep
(4) |
Oct
(4) |
Nov
(11) |
Dec
(8) |
2011 |
Jan
(10) |
Feb
(11) |
Mar
(10) |
Apr
(14) |
May
(6) |
Jun
(8) |
Jul
(9) |
Aug
(11) |
Sep
(13) |
Oct
(7) |
Nov
(9) |
Dec
(1) |
2012 |
Jan
(5) |
Feb
(14) |
Mar
(4) |
Apr
(25) |
May
(18) |
Jun
(18) |
Jul
(3) |
Aug
(6) |
Sep
(3) |
Oct
(16) |
Nov
(5) |
Dec
(12) |
2013 |
Jan
(1) |
Feb
(6) |
Mar
(14) |
Apr
(34) |
May
(9) |
Jun
(3) |
Jul
(8) |
Aug
|
Sep
(10) |
Oct
(11) |
Nov
(11) |
Dec
(15) |
2014 |
Jan
(2) |
Feb
(6) |
Mar
(11) |
Apr
(12) |
May
(6) |
Jun
(7) |
Jul
|
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(5) |
Dec
(6) |
2015 |
Jan
(15) |
Feb
(4) |
Mar
(7) |
Apr
(8) |
May
(1) |
Jun
(18) |
Jul
(27) |
Aug
(13) |
Sep
(4) |
Oct
(8) |
Nov
(7) |
Dec
(6) |
2016 |
Jan
(4) |
Feb
(5) |
Mar
|
Apr
(15) |
May
(5) |
Jun
(4) |
Jul
(1) |
Aug
(1) |
Sep
(7) |
Oct
(2) |
Nov
(4) |
Dec
(2) |
2017 |
Jan
(7) |
Feb
(1) |
Mar
(17) |
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
(3) |
Sep
(3) |
Oct
|
Nov
(5) |
Dec
(6) |
2018 |
Jan
(23) |
Feb
(17) |
Mar
(4) |
Apr
(5) |
May
(6) |
Jun
(3) |
Jul
(5) |
Aug
(2) |
Sep
(3) |
Oct
(2) |
Nov
(5) |
Dec
|
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(8) |
Jul
(8) |
Aug
|
Sep
(2) |
Oct
(9) |
Nov
|
Dec
(1) |
2021 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(3) |
Oct
(3) |
Nov
(1) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: John V. S. <js...@gm...> - 2009-10-18 22:20:17
|
Thanks Santiago, but someone else beat you to it and it was fixed in a subsequent release. You can find more of the blow-by-blow here: http://cafenate.blogspot.com/2008/05/analysis-of-java-implementations-of.html The latest code is here: http://jgrapht.svn.sourceforge.net/viewvc/jgrapht/trunk/src/org/jgrapht/util/FibonacciHeap.java?revision=645&view=markup Using 32 instead of the Math calls may be good enough, so if anyone notices excessive CPU usage from the Math calls showing up in a profiler, we could change it. JVS Santiago Gutierrez wrote: > Dear Jgrapht team: > > > My name is Santiago Gutierrez, I am from Colombia in South America. > While trying to solve a problem at ICPC I was in the need of a fibonnaci > heap. Browsing the internet I found the fibonacci heap from your project > and tried to use it in my problem. I then found that the fibonacci heap > was not as fast as it should be, making my algorithm O(n^2) and not > O(nlog(n)). After seeing the code I found that the problem was in this > function: > > > Consolidates the trees in the heap by joining trees of equal degree > until there are no more trees of equal degree in the root list. > Running time: O(log n) amortized > > protected void consolidate▾ <http://grepcode.com/file/repo1.maven.org$maven2@org.jgrapht$jgrapht-jdk1.5@0.7.3@org$jgrapht$util$FibonacciHeap.java#>() > 435 { > 436 int arraySize = nNodes + 1; > 437 List <http://grepcode.com/file/repository.grepcode.com$java$root@jdk$openjdk@6-b14@java$util$List.java#List><FibonacciHeapNode <http://grepcode.com/file/repo1.maven.org$maven2@org.jgrapht$jgrapht-jdk1.5@0.7.3@org$jgrapht$util$FibonacciHeapNode.java#FibonacciHeapNode><T>> array = > 438 new ArrayList <http://grepcode.com/file/repository.grepcode.com$java$root@jdk$openjdk@6-b14@java$util$ArrayList.java#ArrayList><FibonacciHeapNode <http://grepcode.com/file/repo1.maven.org$maven2@org.jgrapht$jgrapht-jdk1.5@0.7.3@org$jgrapht$util$FibonacciHeapNode.java#FibonacciHeapNode><T>>(arraySize); > 439 > 440 // Initialize degree array > 441 for (int i = 0; i < arraySize; i++) { > 442 array.add <http://grepcode.com/file/repository.grepcode.com$java$root@jdk$openjdk@6-b14@java$util$List.java#List.add(org.jgrapht.util.FibonacciHeapNode)>(null); > 443 } > > > > I found through wikipedia that the fibonacci heap always mantain a degree of it's trees of > maximum log(n), thus the line: > > int arraySize = nNodes + 1 > > > Can be safely change to: > > int arraySize = 32 > > Effectively making the function the log(n) function that it should be. (And indeed my code acc). > > Thanks a lot for all your hard effort, > > Santiago Gutierrez A. > > > ------------------------------------------------------------------------ > Connect to the next generation of MSN Messenger Get it now! > <http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline> |
From: Joshua T. <jos...@gm...> - 2009-10-17 02:50:30
|
DEar Group, I am a new user to jgraphT I have used Eclipse to import jgraphT I could not understand which files are the source files. I tried with jgrapht-0-8-1 -> demo-> CompleteGraphDemo.java it shows me launch error. Can anyone help on this?> JJ |
From: John V. S. <js...@gm...> - 2009-10-02 18:02:12
|
Check out gralog, it is based on JGraphT and might have what you want: http://gralog.sourceforge.net/ JVS Joris Kinable wrote: > Dear, > > I'm about to start a project with some complex path selection > algorithms. For that purpose I'm looking for a graph library which is > easily adaptable so I can easily build in support for more complex > edge costs. Furthermore, if I have a graph and run for example > Dijkstra's shortest path algorithm on it, I would like to visualize > the selected path in a graphical way. Do you know whether that is > possible with JgraphT or are you aware of any other java libraries > with such capabilities build in? > > br, > > Joris > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > |
From: Joris K. <de...@gm...> - 2009-10-02 10:51:35
|
Dear, I'm about to start a project with some complex path selection algorithms. For that purpose I'm looking for a graph library which is easily adaptable so I can easily build in support for more complex edge costs. Furthermore, if I have a graph and run for example Dijkstra's shortest path algorithm on it, I would like to visualize the selected path in a graphical way. Do you know whether that is possible with JgraphT or are you aware of any other java libraries with such capabilities build in? br, Joris |
From: Stefan F. <sfr...@gm...> - 2009-08-25 12:32:14
|
Hi all, when using the JGraphModelAdapter to visualize a jgrapht graph all vertex objects are at the same position. Is there a way to get a nice layout without using the JGraph layout managers (license needed)? Maybe even an alternative to jgraph? Thanks Stefan |
From: John V. S. <js...@gm...> - 2009-08-20 23:29:11
|
Johan Henriksson wrote: > Hello, Hi Johan, thanks for writing. > I am converting a C++ levelsets code and I am getting wrong results. the > question is then where the bug is; my conversion, the C++ code or the > fibonacci heap from jgrapht. I have rather high confidence in my > conversion, hence I wonder how well tested you consider the fibonacci > code? is it actively in use? (then I would consider it well tested). I > rely heavily on changing keys, hence fibonacci. The fib code originally came from Nathan Fiedler. It has been modified a few times since then based on other work (such as the addition of generics to JGraphT) and performance suggestions. Nathan's code has undergone changes since then as well: http://cafenate.blogspot.com/2008/05/analysis-of-java-implementations-of.html I haven't followed up on everything in that post, but I'm not aware of any correctness issues. The implementation is used by JGraphT's DijkstraShortestPath/ClosestFirstIterator, so it gets used heavily by a number of applications. But you never know...there could certainly be a bug. If you can isolate a unit test demonstrating incorrect behavior, that would be very valuable. > also, why does the fibonacci node take a key, while insert() also takes > a key, and the node key cannot be changed? the design is very confusing. > I would expect a single location where the key can be set, either > insert() or new FibNode, not both. Good question :) I'll clean it up. JVS |
From: John V. S. <js...@gm...> - 2009-08-20 20:32:51
|
JGraphT is an algorithm library (not a rendering library) so it's up to you to layer on views. JVS Tim Whitten wrote: > I’m trying to use jgrapht in a servlet. Is there any way to display the > graph via a servlet? > > > > Tim Whitten > > Software Engineer > > Applied Enterprise Solutions, LLC > > tim...@ae... <mailto:tim...@ae...> > > Phone: (662) 213-9187 > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > > ------------------------------------------------------------------------ > > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users |
From: John V. S. <js...@gm...> - 2009-08-20 20:32:00
|
Stefan Fritz wrote: > Hi all, > > I'm looking for a graph libary which supports comparing 2 graphs. > I'd like to create a graph of interactions in our software framework, > compare the resulting graph to a predefined "expected" graph. > These graphs can be very complex and deep. > > Is this use case supported by jgrapht? > Any examples? There is some brute-force code for isomorphism in the experimental package, but it's unlikely to be what you're looking for unless you already have distinguishing labels on the vertices (in which case it's a rather trivial problem). JVS |
From: Stefan F. <sfr...@gm...> - 2009-08-20 12:47:02
|
Hi all, I'm looking for a graph libary which supports comparing 2 graphs. I'd like to create a graph of interactions in our software framework, compare the resulting graph to a predefined "expected" graph. These graphs can be very complex and deep. Is this use case supported by jgrapht? Any examples? Thanks Stefan |
From: Tim W. <Tim...@ae...> - 2009-08-19 20:23:26
|
I'm trying to use jgrapht in a servlet. Is there any way to display the graph via a servlet? Tim Whitten Software Engineer Applied Enterprise Solutions, LLC tim...@ae...<mailto:tim...@ae...> Phone: (662) 213-9187 |
From: Khanh N. <kn...@cs...> - 2009-08-15 21:59:15
|
Hi, Is there a way to save and load a graph using jgrapht? I found GraphMLExporter but couldn't find an importer for it. Thanks -k |
From: Khanh N. <kn...@cs...> - 2009-08-11 14:34:32
|
Hi, Thank you very much for your response. I took a closer look yesterday, I'm currently using NeighborIndex, is it efficient? My graph has 10.000 nodes. -k On Tue, Aug 11, 2009 at 12:18 AM, Xueyang Zhu<xue...@gm...> wrote: > HI, > > Try the following: > > for(DefaultEdge e:g.edgesOf(X)){ > Vertex v=g.getEdgeTarget(e); > ..... > > } > > > > 2009/8/10 Khanh Nguyen <ngu...@gm...> >> >> Hello all, >> >> I am new to JGraphT (just started this morning). I am working on a >> simple random search on a graph and I need to get the set of neighbors >> of each vertex. How do I do it? >> >> My attempt is to use edgesOf() method to get the set of edges of >> vertex X, but I don't know how to go next from there, as all methods >> in DefaultVertex are protected. It looks like this >> >> Set<DefaultEdge> s = g.edgesOf(X); >> ...? >> >> I guess, I could also try to implement an Iterator? but it seems more >> advanced at this point for me. >> >> Thanks. >> >> -k >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> jgrapht-users mailing list >> jgr...@li... >> https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > |
From: Xueyang Z. <xue...@gm...> - 2009-08-11 04:18:25
|
HI, Try the following: for(DefaultEdge e:g.edgesOf(X)){ Vertex v=g.getEdgeTarget(e); ..... } 2009/8/10 Khanh Nguyen <ngu...@gm...> > Hello all, > > I am new to JGraphT (just started this morning). I am working on a > simple random search on a graph and I need to get the set of neighbors > of each vertex. How do I do it? > > My attempt is to use edgesOf() method to get the set of edges of > vertex X, but I don't know how to go next from there, as all methods > in DefaultVertex are protected. It looks like this > > Set<DefaultEdge> s = g.edgesOf(X); > ...? > > I guess, I could also try to implement an Iterator? but it seems more > advanced at this point for me. > > Thanks. > > -k > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > |
From: Khanh N. <ngu...@gm...> - 2009-08-10 13:52:20
|
Hello all, I am new to JGraphT (just started this morning). I am working on a simple random search on a graph and I need to get the set of neighbors of each vertex. How do I do it? My attempt is to use edgesOf() method to get the set of edges of vertex X, but I don't know how to go next from there, as all methods in DefaultVertex are protected. It looks like this Set<DefaultEdge> s = g.edgesOf(X); ...? I guess, I could also try to implement an Iterator? but it seems more advanced at this point for me. Thanks. -k |
From: John V. S. <js...@gm...> - 2009-07-12 07:03:29
|
Daniel Bell wrote: > Is it possible to use DijkstraShortestPath to calculate the shortest > paths to all destinations from a specified vertex? If not, is there a > way that you would recommend extending the framework to accommodate this > use case? I’d be happy to contribute the code if that’s the case. Yes, you can use an instance of org.jgrapht.traverse.ClosestFirstIterator for this purpose. The DijkstraShortestPath class is actually just a wrapper for it. JVS |
From: John V. S. <js...@gm...> - 2009-07-06 02:25:52
|
John V. Sichi wrote: > This release includes a number of bugfixes and contributions which have > accumulated since the 0.8.0 release. You can find a description of the > changes here: > > http://jgrapht.wikispaces.com/Release0.8.1 > > Big thanks to all who made suggestions and code contributions for this > release, especially Andrew Newell and Tom Larkworthy for the new > algorithm implementations. I forgot to mention Ilya Razenshteyn's contribution of GraphUnion; I've corrected the release notes in wiki and Subversion. Unfortunately, Ilya did not get a chance to finish up with optimizations and unit tests due to illness, so if anyone else wants to finish up the development here, please send me your code/tests. Thanks, JVS |
From: John V. S. <js...@gm...> - 2009-07-04 07:49:08
|
This release includes a number of bugfixes and contributions which have accumulated since the 0.8.0 release. You can find a description of the changes here: http://jgrapht.wikispaces.com/Release0.8.1 Big thanks to all who made suggestions and code contributions for this release, especially Andrew Newell and Tom Larkworthy for the new algorithm implementations. JVS |
From: John V. S. <js...@gm...> - 2009-06-30 04:44:23
|
Thanks a lot! I have committed it to Subversion. JVS Tom Larkworthy wrote: > Hello, I wrote this in order to get the diameter of a graph > > Calculates all shortests path pairs in O(n^3) > > in (correct) package:- > > org.jgrapht.alg > > > There is a test in the main > > Hope it helps > > Tom Larkworthy > |
From: Alexandros M. <al...@di...> - 2009-05-13 17:02:54
|
Hi i am using the following code to create a graph from an adjacency Table and to find the maximal cliques void findAllCliques() { UndirectedGraph<Integer, DefaultEdge> g = new SimpleGraph<Integer, DefaultEdge>(DefaultEdge.class); for (int i = 0; i < this.adjacencyTable.length; i++) { g.addVertex(i); } for (int i = 0; i < this.adjacencyTable.length; i++) { for (int j = i + 1; j < this.adjacencyTable.length; j++) { //if (i == j) { // continue; //} if (this.adjacencyTable[i][j] > 0) { if( g.containsEdge( i, j ) == false ) g.addEdge(i, j); //else { // System.out.println( i + " " + j + "is all ready in" ); //} } } } //System.out.println("calling Libarary"); BronKerboschCliqueFinder algorithm = new BronKerboschCliqueFinder(g); //System.out.println("library finished"); this.cliques = algorithm.getAllMaximalCliques(); //System.out.println("cliques geted"); } But it seems like the library goes into an infinite loop becouse it never returns from the this.cliques = algorithm.getAllMaximalCliques(); has anyone seen this problem again?? |
From: John V. S. <js...@gm...> - 2009-05-11 20:18:38
|
I've checked in a toString implementation which just calls toString on the edge list. JVS John V. Sichi wrote: > There is no mistake; it's just that the KShortestPaths.PathWrapper does > not have a toString() method, so List.toString prints the Java object > ID's instead. > > JVS > > Achim Beutel wrote: >> Hi, >> >> I am trying to use the getPath() method from the KShortestPaths class >> but without any luck (current version). >> >> I defined a new graph: >> DirectedGraph<String, DefaultEdge> directedGraph = new >> DefaultDirectedGraph<String, DefaultEdge> (DefaultEdge.class); >> >> and added some vertices and edges. Then: >> >> KShortestPaths shortestPaths = new KShortestPaths(directedGraph, >> "vertex1", 2); >> List path = shortestPaths.getPaths("vertex2"); >> >> Now, I get an output like this for 'path': >> [org.jgrapht.alg.KShortestPaths$PathWrapper@24f420, >> org.jgrapht.alg.KShortestPaths$PathWrapper@24f410] >> >> Where is my mistake? >> >> Thanks! > > |
From: John V. S. <js...@gm...> - 2009-05-11 19:21:47
|
There is no mistake; it's just that the KShortestPaths.PathWrapper does not have a toString() method, so List.toString prints the Java object ID's instead. JVS Achim Beutel wrote: > Hi, > > I am trying to use the getPath() method from the KShortestPaths class but without any luck (current version). > > I defined a new graph: > DirectedGraph<String, DefaultEdge> directedGraph = new DefaultDirectedGraph<String, DefaultEdge> (DefaultEdge.class); > > and added some vertices and edges. Then: > > KShortestPaths shortestPaths = new KShortestPaths(directedGraph, "vertex1", 2); > List path = shortestPaths.getPaths("vertex2"); > > Now, I get an output like this for 'path': > [org.jgrapht.alg.KShortestPaths$PathWrapper@24f420, org.jgrapht.alg.KShortestPaths$PathWrapper@24f410] > > Where is my mistake? > > Thanks! |
From: Achim B. <A.B...@gm...> - 2009-05-11 15:38:28
|
Hi, I am trying to use the getPath() method from the KShortestPaths class but without any luck (current version). I defined a new graph: DirectedGraph<String, DefaultEdge> directedGraph = new DefaultDirectedGraph<String, DefaultEdge> (DefaultEdge.class); and added some vertices and edges. Then: KShortestPaths shortestPaths = new KShortestPaths(directedGraph, "vertex1", 2); List path = shortestPaths.getPaths("vertex2"); Now, I get an output like this for 'path': [org.jgrapht.alg.KShortestPaths$PathWrapper@24f420, org.jgrapht.alg.KShortestPaths$PathWrapper@24f410] Where is my mistake? Thanks! -- Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a |
From: John V. S. <js...@gm...> - 2009-05-07 01:08:23
|
Claudio Martella wrote: > I just want to understand if this is the correct thing or if you have > any furthers suggestion for speed optimization for local neighborhood > analysis. Your code looks correct to me. JVS |
From: Claudio M. <cla...@gm...> - 2009-05-06 21:07:21
|
Ok, what I did after I wrote the email is change my graph to ListenableDirectedWeightedGraph and then i changed the constructor to this: public MyGraph() { super(DefaultWeightedEdge.class); indexer = new DirectedNeighborIndex<MyVertex, DefaultWeightedEdge>(this); addGraphListener(indexer); } Then i implemented two methods: public Set<MyVertex> successorsOf(MyVertex vertex) { return indexer.successorOf(vertex); } public Set<MyVertex> precedessorsOf(MyVertex vertex){ return indexer.precedessorsOf(vertex); } I just want to understand if this is the correct thing or if you have any furthers suggestion for speed optimization for local neighborhood analysis. TIA /CM On Wed, May 6, 2009 at 8:09 PM, John V. Sichi <js...@gm...> wrote: > Claudio Martella wrote: >> >> I'm implementing a few algorithms that make extensive use of local >> neighborhoods of Vertexes. Therefore I'd like to use >> DirectedNeighborIndex class to speed up the computation. At the moment >> I've extended SimpleDirectedWeightedGraph and added the methods >> outgoingVertexesOf(V) and incomingVertexesOf(V), both cycling over the >> results of outgoingEdgesOf() and incomingEdgesOf(). What I'm trying to >> understand is re-implementing these outgoingVertexesOf() and >> incomingVertexesOf() with calls to predecessorOf() and successorOf() >> of DirectedNeighborhorIndex is the smartest way to optimize my code. >> My second question, connected to the first one, is if it's possible, >> if it's not already been used, to ask the graph to cache the calls >> internally for some computation. > > I don't understand. The DirectedNeighborIndex javadoc explains that you are > supposed to create the index and then add it as a listener to the graph; you > don't need to modify the graph itself. The caching already happens inside > of DirectedNeighborIndex. > > JVS > -- Claudio Martella cla...@gm... |
From: John V. S. <js...@gm...> - 2009-05-06 18:09:51
|
Claudio Martella wrote: > I'm implementing a few algorithms that make extensive use of local > neighborhoods of Vertexes. Therefore I'd like to use > DirectedNeighborIndex class to speed up the computation. At the moment > I've extended SimpleDirectedWeightedGraph and added the methods > outgoingVertexesOf(V) and incomingVertexesOf(V), both cycling over the > results of outgoingEdgesOf() and incomingEdgesOf(). What I'm trying to > understand is re-implementing these outgoingVertexesOf() and > incomingVertexesOf() with calls to predecessorOf() and successorOf() > of DirectedNeighborhorIndex is the smartest way to optimize my code. > My second question, connected to the first one, is if it's possible, > if it's not already been used, to ask the graph to cache the calls > internally for some computation. I don't understand. The DirectedNeighborIndex javadoc explains that you are supposed to create the index and then add it as a listener to the graph; you don't need to modify the graph itself. The caching already happens inside of DirectedNeighborIndex. JVS |