faultCode0faultStringWarning:include_once(analyticstracking.php): failed to open stream: No such file or directory in /data/htdocs-users/hogie/public_html/software/index.php on line 7faultCode0faultStringWarning:include_once(): Failed opening 'analyticstracking.php' for inclusion (include_path='.:/usr/share/php5:/usr/share/php') in /data/htdocs-users/hogie/public_html/software/index.php on line 7 High performance graph library for Java
The high performance graph library for Java
Home › Code samples

First of all, in development mode, start with this line. It enables the assertions, which are heavily used by Grph. Doing this makes the library more robust and slows downs it a bit. ClassLoader.getSystemClassLoader().setDefaultAssertionStatus(true);

Creating a 4x4 grid and display it in a graphical view: Grph g = new InMemoryGrph(); g.grid(4, 4); g.display();

Computing the diameter of the graph: int d = g.getDiameter();

Writing it on disk, in a file named myfile.txt: RegularFile f = new RegularFile("myfile.txt"); f.setContent(g.toGrphText().getBytes());

Efficiently iterating on the vertices of the graph, using the cache: for (int v : g.getVertices().toArray()) { ... }

If the graph changes very often, you better avoid using the cache, like this: for (IntCursor vertexCursor : g.getVertices()) { int v = vertexCursor.value; ... }