jung

Interactive Python Network/Graph Modeling

南笙酒味 提交于 2019-12-20 18:31:08
问题 I'm looking for a python library that will allow me to interactively draw networks and graphs and attach data to nodes and edges. I have found two libraries for Java that seem to do what I need: JUNG and piccolo2d. Are there any python equivalents to these? 回答1: Have a look at: matplotlib - Here are some graphs made with it. networkx igraph 回答2: Using GNU/Radio Companion, I was able to accomplish what I needed by performing some extensions here and there. It is not the best solution since it

Change Size/Color of Vertex in JUNG

你离开我真会死。 提交于 2019-12-18 11:38:07
问题 How do you change the size of a specific vertex in Jung Visualization Library? I'm reading the documentation but I'm not extremely familiar with java and I can't find any good examples on line. 回答1: It took me a while, but here is a readable, fully-commented program that changes the vertex size and color in a graph. Enjoy! public class SimpleGraphView { public SimpleGraphView() { // Create a graph with Integer vertices and String edges Graph<Integer, String> g = new SparseGraph<Integer,

Vertex label in JUNG graph visualization

对着背影说爱祢 提交于 2019-12-17 19:50:01
问题 I wrote a little graph visualizer class: public void simpleGraph(SparseMultigraph<Vertex,SEdge> graph, String name) { Layout<Vertex, SEdge> layout = new ISOMLayout(graph); layout.setSize(new Dimension(800,800)); BasicVisualizationServer<Vertex, SEdge> vv = new BasicVisualizationServer<Vertex, SEdge>(layout); vv.setPreferredSize(new Dimension(850,850)); //Sets the viewing area size JFrame frame = new JFrame(name); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add

Can Jung graphics appear in the same place every time?

自作多情 提交于 2019-12-14 03:53:34
问题 I'm using JUNG ( http://jung.sourceforge.net/index.html ) to draw graphics in java. The software is great but I have a small question. How can I be sure that the displayed graph is each time the same (no changes is architecture or position)? To be more specific: the graph model (data to be represented) doesn't change but its representation changes each time I hit the "View graph" button :) [some vertices are in other places, for example: sometimes in the upper part of the window, sometimes in

Q: How to change arrow position or remove it from an edge ? (JUNG)

做~自己de王妃 提交于 2019-12-13 08:37:24
问题 What the question states.I have many arrows connecting to one Node and it looks very cluttered on the graph. Any way to relocate the arrows towards the center or remove them ? 回答1: By default, directed edges are rendered with arrowheads on them so that you can see the direction of the edge. If you don't want the arrowheads to be present at all: visualizationViewer.getRenderContext().setEdgeArrowPredicate(false); If you want the arrowheads to be present, but rendered in the middle of their

weird import issues - Jung2

拜拜、爱过 提交于 2019-12-13 02:47:42
问题 I've been trying to get Jung 2.1.1 to work successfully but whatever breaking changes were made are just not making sense. After importing the 2.1.1 jars, I get the error: The constructor VisualizationViewer(Network, LayoutAlgorithm, Dimension) is undefined for the line: VisualizationViewer vv = new VisualizationViewer(g, layoutAlgorithm, new Dimension(900, 900)); where Network g = NetworkBuilder.undirected().build(); // and other load steps There are other imports that aren't working, like

Finding all paths in JUNG?

心已入冬 提交于 2019-12-12 21:35:34
问题 Hi I was wondering if there is any way to find all the possible paths between two nodes N1 and N2 in JUNG. Thanks in advance for any help :) 回答1: I had some tasks in which i required all paths from vertex A to B. Here, I took the ShortestPathDemo.java and modified it a bit to call it PathDemo.java. One can find both shortest and full path in a graph. /****************************** PathDemo.java ******************************/ /* * Created on Jan 2, 2004 */ package exasym; import java.awt

Java Jung Vertex Cuts in Graphs

一个人想着一个人 提交于 2019-12-12 05:25:10
问题 I am trying to do vertex cuts on graphs in the JUNG graph package. This is best explained by the following pictures: Now, I am going to cut vertex "c1" out of the graph: As you can see vertex "c1" has been removed from the graph, but so have the vertices "c2" and "c3" I want the vertices "c2" and "c3" to stay in the graph when I cut vertex "c1". I am using the removeVertex(V vertex) function to remove vertex "c1" from the graph. How can I implement my code to keep vertices "c2" and "c3" when

adding a node to a collection using JUNG2

百般思念 提交于 2019-12-12 04:09:59
问题 I am trying to add a node like this ( C.add(n))) I have this problem: Exception in thread "main" java.lang.UnsupportedOperationException at java.util.Collections$UnmodifiableCollection.add(Unknown Source)) Non-executable code example: UndirectedSparseMultigraph<MyNode, MyLink> g = getgraph1(); Collection<MyNode> c = null ; for( MyNode n : g.getVertices() ){ if( n.id == 3 ){ c = g.getNeighbors(n); System.out.println(C); C.add(n); } } 回答1: You are trying to use UndirectedSparseMultigraph

How to filter the result of KNeighborhoodFilter?

假如想象 提交于 2019-12-12 00:07:29
问题 I have a UndirectedSparseGraph g in which I have stored two kind of Node, namely User and Thread that both extend Node. I would like, for a User u, to retrieve its 2-dist neighborhood, i.e. other users that are linked with u because they have an edge to the threads belonging to u's 1-dist neighborhood. I know that KNeighborhoodFilter is the way to retrieve nodes "in radius" k from the caller node... this means, in my case, that both threads at 1 hop and users at 2 hops will be returned, and