jgrapht-users Mailing List for JGraphT (Page 30)
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 S. <js...@gm...> - 2011-03-24 06:44:46
|
The implementation currently uses HashMap; we could change it to LinkedHashMap for determinism. JVS 2011/3/23 Alexandre Fréchette <fre...@gm...>: > Hi, > I am using jgrapht for its double-precision implementation of a maximum flow > algorithm. However, I am running > into a problem with the EdmondsKarpMaximumFlow object. I will create a > graph, find a maximum st-flow in that graph > and it will return a value. Then if I rerun my algorithm with the same data, > I will get a different value for the maximum flow. > Would you know what is causing the problem? > Alexandre Fréchette > > ------------------------------------------------------------------------------ > Enable your software for Intel(R) Active Management Technology to meet the > growing manageability and security demands of your customers. Businesses > are taking advantage of Intel(R) vPro (TM) technology - will your software > be a part of the solution? Download the Intel(R) Manageability Checker > today! http://p.sf.net/sfu/intel-dev2devmar > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > |
From: Alexandre F. <fre...@gm...> - 2011-03-24 01:38:50
|
Hi, I am using jgrapht for its double-precision implementation of a maximum flow algorithm. However, I am running into a problem with the EdmondsKarpMaximumFlow object. I will create a graph, find a maximum st-flow in that graph and it will return a value. Then if I rerun my algorithm with the same data, I will get a different value for the maximum flow. Would you know what is causing the problem? Alexandre Fréchette |
From: John S. <js...@gm...> - 2011-03-17 04:53:44
|
I think you can just use the existing ListenableDirectedGraph wrapped around the existing DirectedMultigraph, no? JVS On Wed, Mar 16, 2011 at 7:51 AM, <jl...@ol...> wrote: > I have written a new edge class called TransitionEdge that extends > DefaultEdge. I want to use JGraph to visualize my graph but I am > having trouble writing a constructor for a > ListenableDirectedMultigraph that allows me to use the TransitionEdge > class...any suggestions? > > private static class ListenableDirectedMultigraph<V, E> > extends DefaultListenableGraph<V, E> > implements DirectedGraph<V, E> > { > private static final long serialVersionUID = 1L; > > > ListenableDirectedMultigraph(Class<? extends E> > classBasedEdgeFactory) > { > super(new DirectedMultigraph<V, > E>(classBasedEdgeFactory)); > } > > > public ListenableDirectedMultigraph(ClassBasedEdgeFactory<String, > TransitionEdge> classBasedEdgeFactory) { > super(??); > } > > > } > > > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > |
From: <jl...@ol...> - 2011-03-16 14:52:00
|
I have written a new edge class called TransitionEdge that extends DefaultEdge. I want to use JGraph to visualize my graph but I am having trouble writing a constructor for a ListenableDirectedMultigraph that allows me to use the TransitionEdge class...any suggestions? private static class ListenableDirectedMultigraph<V, E> extends DefaultListenableGraph<V, E> implements DirectedGraph<V, E> { private static final long serialVersionUID = 1L; ListenableDirectedMultigraph(Class<? extends E> classBasedEdgeFactory) { super(new DirectedMultigraph<V, E>(classBasedEdgeFactory)); } public ListenableDirectedMultigraph(ClassBasedEdgeFactory<String, TransitionEdge> classBasedEdgeFactory) { super(??); } } |
From: <jl...@ol...> - 2011-03-14 17:32:51
|
I am a new JGraph user and I am having trouble drawing my JGraph. I have simply tried editing the JGraphAdapterDemo to use a DirectedGraph instead of ListenableDirected Graph...but it won't work. What am I missing? import java.awt.*; import java.awt.geom.*; import javax.swing.*; import org.jgraph.*; import org.jgraph.graph.*; import org.jgrapht.*; import org.jgrapht.ext.*; import org.jgrapht.graph.*; // resolve ambiguity import org.jgrapht.graph.DefaultEdge; public class GraphAdapterDemo1 extends JApplet { //~ Static fields/initializers --------------------------------------------- private static final long serialVersionUID = 4049071636005206066L; private static final Color DEFAULT_BG_COLOR = Color.decode("#FAFBFF"); private static final Dimension DEFAULT_SIZE = new Dimension(530, 320); private JGraphModelAdapter<String, DefaultEdge> jgAdapter; public static void main(String [] args) { GraphAdapterDemo1 applet = new GraphAdapterDemo1(); applet.init(); JFrame frame = new JFrame(); frame.getContentPane().add(applet); frame.setTitle("JGraphT Adapter to JGraph Demo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); } public void init() { // create a JGraphT graph DirectedGraph<String, DefaultEdge> g = new DirectedMultigraph<String, DefaultEdge>( DefaultEdge.class); // create a visualization using JGraph, via an adapter jgAdapter = new JGraphModelAdapter<String, DefaultEdge>(g); JGraph jgraph = new JGraph(jgAdapter); adjustDisplaySettings(jgraph); getContentPane().add(jgraph); resize(DEFAULT_SIZE); String v1 = "v1"; String v2 = "v2"; String v3 = "v3"; String v4 = "v4"; // add some sample data (graph manipulated via JGraphT) g.addVertex(v1); g.addVertex(v2); g.addVertex(v3); g.addVertex(v4); g.addEdge(v1, v2); g.addEdge(v2, v3); g.addEdge(v3, v1); g.addEdge(v4, v3); // position vertices nicely within JGraph component positionVertexAt(v1, 130, 40); positionVertexAt(v2, 60, 200); positionVertexAt(v3, 310, 230); positionVertexAt(v4, 380, 70); } private void adjustDisplaySettings(JGraph jg) { jg.setPreferredSize(DEFAULT_SIZE); Color c = DEFAULT_BG_COLOR; String colorStr = null; try { colorStr = getParameter("bgcolor"); } catch (Exception e) { } if (colorStr != null) { c = Color.decode(colorStr); } jg.setBackground(c); } @SuppressWarnings("unchecked") // FIXME hb 28-nov-05: See FIXME below private void positionVertexAt(Object vertex, int x, int y) { DefaultGraphCell cell = jgAdapter.getVertexCell(vertex); AttributeMap attr = cell.getAttributes(); Rectangle2D bounds = GraphConstants.getBounds(attr); Rectangle2D newBounds = new Rectangle2D.Double( x, y, bounds.getWidth(), bounds.getHeight()); GraphConstants.setBounds(attr, newBounds); // TODO: Clean up generics once JGraph goes generic AttributeMap cellAttr = new AttributeMap(); cellAttr.put(cell, attr); jgAdapter.edit(cellAttr, null, null, null); } } |
From: janani a. <jan...@gm...> - 2011-03-04 04:40:14
|
hi everyone, i am new to jgrapht n java.i need to develop a "graph creator" application as a part of the acadamics.i would like to create a stand alone java swing project using jgrapht.a part of the code is as shown.is this how i should add jgraph to JPanel(this code is not helping). ... JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel pane=new JPanel(); frame.setContentPane(pane); ListenableGraph<String , DefaultEdge> g = new ListenableDirectedMultigraph<String , DefaultEdge>( DefaultEdge.class); jgAdapter = new JGraphModelAdapter<String , DefaultEdge>(g); JGraph jgraph = new JGraph(jgAdapter); adjustDisplaySettings(jgraph); pane.add(jgraph); //add vertices and edges. frame.pack(); frame.setVisible(true); ... thank you, janani |
From: Ricardo R. <ric...@gm...> - 2011-02-28 21:36:40
|
It seems you're right, I carefully reviewed my code, and I think I found source of the non-deterministic order. Sorry for that... and thanks for the help. Regards, 2011/2/28 John Sichi <js...@gm...> > We already us LinkedHashXXX for the default graph implementations. > Are you sure it's not some other non-deterministic aspect of your > traversal? > > JVS > > On Sun, Feb 27, 2011 at 7:23 PM, Ricardo Redder > <ric...@gm...> wrote: > > Hi, > > I was wondering if there is a "suggested" way of choosing the Set > > implementation used by the Graph implementations (edge's and vertex's > Sets). > > I am facing a few problems with unit tests, because my program output > keeps > > changing since the iteration is not deterministic. So... a few questions: > > > > Would it possible to simply change the Set implementation used by a graph > > implementation? e.g.: Force DefaultDirectedGraph to use LinkedHashSet for > > vertexSet() instead the default implementation? > > Is there a significant impact, like a big performance degradation, or > > maybe operation's correctness? > > If it cannot be done, is there a Graph implementation that provides > > deterministic iteration over these sets? > > > > Thanks in advance for any help. > > Regards, > > -- > > Redder > > > > > ------------------------------------------------------------------------------ > > Free Software Download: Index, Search & Analyze Logs and other IT data in > > Real-Time with Splunk. Collect, index and harness all the fast moving IT > > data > > generated by your applications, servers and devices whether physical, > > virtual > > or in the cloud. Deliver compliance at lower cost and gain new business > > insights. http://p.sf.net/sfu/splunk-dev2dev > > _______________________________________________ > > jgrapht-users mailing list > > jgr...@li... > > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > > > > -- Redder |
From: John S. <js...@gm...> - 2011-02-28 07:35:52
|
We already us LinkedHashXXX for the default graph implementations. Are you sure it's not some other non-deterministic aspect of your traversal? JVS On Sun, Feb 27, 2011 at 7:23 PM, Ricardo Redder <ric...@gm...> wrote: > Hi, > I was wondering if there is a "suggested" way of choosing the Set > implementation used by the Graph implementations (edge's and vertex's Sets). > I am facing a few problems with unit tests, because my program output keeps > changing since the iteration is not deterministic. So... a few questions: > > Would it possible to simply change the Set implementation used by a graph > implementation? e.g.: Force DefaultDirectedGraph to use LinkedHashSet for > vertexSet() instead the default implementation? > Is there a significant impact, like a big performance degradation, or > maybe operation's correctness? > If it cannot be done, is there a Graph implementation that provides > deterministic iteration over these sets? > > Thanks in advance for any help. > Regards, > -- > Redder > > ------------------------------------------------------------------------------ > Free Software Download: Index, Search & Analyze Logs and other IT data in > Real-Time with Splunk. Collect, index and harness all the fast moving IT > data > generated by your applications, servers and devices whether physical, > virtual > or in the cloud. Deliver compliance at lower cost and gain new business > insights. http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > |
From: Ricardo R. <ric...@gm...> - 2011-02-28 03:23:37
|
Hi, I was wondering if there is a "suggested" way of choosing the Set implementation used by the Graph implementations (edge's and vertex's Sets). I am facing a few problems with unit tests, because my program output keeps changing since the iteration is not deterministic. So... a few questions: - Would it possible to simply change the Set implementation used by a graph implementation? e.g.: Force DefaultDirectedGraph to use LinkedHashSet for vertexSet() instead the default implementation? - Is there a significant impact, like a big performance degradation, or maybe operation's correctness? - If it cannot be done, is there a Graph implementation that provides deterministic iteration over these sets? Thanks in advance for any help. Regards, -- Redder |
From: Neal L. <im...@gm...> - 2011-02-23 21:28:59
|
Thank you, Hmm... I must have done something wrong then with the setup, because this is how envisioned the graph.. I keep thinking of the edges defined by their names, not what they connect. edge1: node1 - node2 edge2: node2 - node3 edge1: node3 - node4 Or: "mother has cancer, father has diabetes" nsubj: has-2 - mother-1 dobj: has-2 - cancer-3 nsubj: has-5 - father-4 dobj: has-5 - diabetes-6 These are different edges with the same name. I almost overrode the contains() function, but was worried I would get strange results. What I ended up doing was using the Typed Dependencies as the edges, instead of the grammatical relations. Very sloppy, but it works. Thanks again! Neal On 02/22/2011 04:42 PM, Ricardo Redder wrote: > Hi... > SimpleGraph does allow more than one edge for nodes, what it does not > allow is more than one edge between two specific nodes. > > For instance, the following relations are allowed by SimpleGraphs: > edge1: node1 - node2 > edge2: node1 - node3 > > And the following relations are not: > edge1: node1 - node2 > edge2: node1 - node2 > > So... unless you want more than one edge between a specific pair, I > think you can still use SimpleGraph... > > Regards, > > 2011/2/22 Neal Lewis <im...@gm... <mailto:im...@gm...>> > > I ran into a problem with using the grammatical relations between > nodes as the edges and words as the nodes. I have tried with a > Simple Graph, MultipGraph, and PseudoGraph. > > I implemented it in this fashion : > > public class DependencyGraph extends > SimpleGraph<TreeGraphNode, GrammaticalRelation> > > public DependencyGraph(ArrayList<TypedDependency> tdl ) > { > super(GrammaticalRelation.class); > this.tdl = tdl; > this.tree =null; > > //build dependency graph from tdl; > for (TypedDependency td : tdl) { > this.addVertex(td.gov <http://td.gov>()); > this.addVertex(td.dep()); > this.addEdge(td.gov <http://td.gov>(), td.dep(), > td.reln()); > } > } > > This works great because I can just grab the edge between to > TreeGraphNodes and understand the relationship. > > However, Because this is perhaps a SimpleGraph (or Multigraph, or > PseudoGraph), it will not lot me have more than on grammatrical > relation edge (I imagine it would be the same if I used Strings > as the edge types). Even though the edge is named "amod", if > there are more than one "amod" relationships in the the > typedDependencyList, these graphs wont load them. > > I am converting the whole typedDependencyList to an undirectedGraph. > > So basically, I want to be able to have more than one edge of the > same name, but with no cycles > > > Is there a graph I can use that would make this work? Or should I > just stick with the default edges? > > Thanks! > Neal > > > On 02/10/2011 08:10 PM, Neal Lewis wrote: >> That's fantastic! I didn't realize this API was so flexible. >> Thanks for an awesome API! >> >> -Neal >> >> On 02/10/2011 07:41 PM, Ricardo Redder wrote: >>> Hi, >>> >>> From the sample in project page: >>> http://nlp.stanford.edu/software/lex-parser.shtml#Sample >>> >>> I imagine the TypedDependencies are: >>> det(rain-3, >>> >>> The-1) >>> amod(rain-3, >>> >>> strongest-2) >>> nsubj(shut-8, >>> >>> rain-3) >>> ... >>> >>> >>> >>> >>> >>> >>> >>> >>> And, by dependecy relations, I understand: det, amod, nsubj, etc.. >>> >>> So... if that's the case, you don't need to use the class >>> DefaultEdge as a type for your edges or extend it, JGraphT is >>> based on Generics... so you can use whatever class which is >>> suitable for you... >>> E.g.: >>> >>> SimpleGraph<String, String> graph = new SimpleGraph<String, >>> String>(String.class); >>> >>> So you can add edges with the desired information: >>> graph.addEdge("rain-3", "The-1", "det"); >>> graph.addEdge("rain-3", "strongest-2", "amod"); >>> graph.addEdge("shut-8", "rain-3", "nsubj"); >>> >>> Probably your vertices and edges are not String's, so you just >>> have to choose the right class for your graphs... >>> I hope I could help you. >>> >>> Regards >>> >>> 2011/2/9 Neal Lewis <im...@gm... <mailto:im...@gm...>> >>> >>> Hello, >>> >>> First off, thanks for such a great API. This had made my >>> life much, >>> much easier. >>> >>> I am applying the graphs to output from the Stanford Parser >>> API, and >>> creating SimpleGraphs Undirected from the TypedDependencies >>> output from >>> the Stanford Parser. I would like to use the dependency >>> relations as >>> edges in the graph, such that I can create a GraphPath of >>> label edges. >>> >>> Is this possible? Has it been down before? >>> >>> Thank you! >>> >>> Neal >>> >>> ------------------------------------------------------------------------------ >>> The ultimate all-in-one performance toolkit: Intel(R) >>> Parallel Studio XE: >>> Pinpoint memory and threading errors before they happen. >>> Find and fix more than 250 security defects in the >>> development cycle. >>> Locate bottlenecks in serial and parallel code that limit >>> performance. >>> http://p.sf.net/sfu/intel-dev2devfeb >>> _______________________________________________ >>> jgrapht-users mailing list >>> jgr...@li... >>> <mailto:jgr...@li...> >>> https://lists.sourceforge.net/lists/listinfo/jgrapht-users >>> >>> >>> >>> >>> -- >>> Redder >> > > > > > -- > Redder |
From: Ricardo R. <ric...@gm...> - 2011-02-23 00:43:05
|
Hi... SimpleGraph does allow more than one edge for nodes, what it does not allow is more than one edge between two specific nodes. For instance, the following relations are allowed by SimpleGraphs: edge1: node1 - node2 edge2: node1 - node3 And the following relations are not: edge1: node1 - node2 edge2: node1 - node2 So... unless you want more than one edge between a specific pair, I think you can still use SimpleGraph... Regards, 2011/2/22 Neal Lewis <im...@gm...> > I ran into a problem with using the grammatical relations between nodes as > the edges and words as the nodes. I have tried with a Simple Graph, > MultipGraph, and PseudoGraph. > > I implemented it in this fashion : > > public class DependencyGraph extends SimpleGraph<TreeGraphNode, > GrammaticalRelation> > > public DependencyGraph(ArrayList<TypedDependency> tdl ) > { > super(GrammaticalRelation.class); > this.tdl = tdl; > this.tree =null; > > //build dependency graph from tdl; > for (TypedDependency td : tdl) { > this.addVertex(td.gov()); > this.addVertex(td.dep()); > this.addEdge(td.gov(), td.dep(), td.reln()); > } > } > > This works great because I can just grab the edge between to TreeGraphNodes > and understand the relationship. > > However, Because this is perhaps a SimpleGraph (or Multigraph, or > PseudoGraph), it will not lot me have more than on grammatrical relation > edge (I imagine it would be the same if I used Strings as the edge > types). Even though the edge is named "amod", if there are more than one > "amod" relationships in the the typedDependencyList, these graphs wont load > them. > > I am converting the whole typedDependencyList to an undirectedGraph. > > So basically, I want to be able to have more than one edge of the same > name, but with no cycles > > > Is there a graph I can use that would make this work? Or should I just > stick with the default edges? > > Thanks! > Neal > > > On 02/10/2011 08:10 PM, Neal Lewis wrote: > > That's fantastic! I didn't realize this API was so flexible. Thanks for > an awesome API! > > -Neal > > On 02/10/2011 07:41 PM, Ricardo Redder wrote: > > Hi, > > From the sample in project page: > http://nlp.stanford.edu/software/lex-parser.shtml#Sample > > I imagine the TypedDependencies are: > det(rain-3, > The-1) > amod(rain-3, > strongest-2) > nsubj(shut-8, > rain-3) > ... > > > > > And, by dependecy relations, I understand: det, amod, nsubj, etc.. > > So... if that's the case, you don't need to use the class DefaultEdge as a > type for your edges or extend it, JGraphT is based on Generics... so you can > use whatever class which is suitable for you... > E.g.: > > SimpleGraph<String, String> graph = new SimpleGraph<String, > String>(String.class); > > So you can add edges with the desired information: > graph.addEdge("rain-3", "The-1", "det"); > graph.addEdge("rain-3", "strongest-2", "amod"); > graph.addEdge("shut-8", "rain-3", "nsubj"); > > Probably your vertices and edges are not String's, so you just have to > choose the right class for your graphs... > I hope I could help you. > > Regards > > 2011/2/9 Neal Lewis <im...@gm...> > >> Hello, >> >> First off, thanks for such a great API. This had made my life much, >> much easier. >> >> I am applying the graphs to output from the Stanford Parser API, and >> creating SimpleGraphs Undirected from the TypedDependencies output from >> the Stanford Parser. I would like to use the dependency relations as >> edges in the graph, such that I can create a GraphPath of label edges. >> >> Is this possible? Has it been down before? >> >> Thank you! >> >> Neal >> >> >> ------------------------------------------------------------------------------ >> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >> Pinpoint memory and threading errors before they happen. >> Find and fix more than 250 security defects in the development cycle. >> Locate bottlenecks in serial and parallel code that limit performance. >> http://p.sf.net/sfu/intel-dev2devfeb >> _______________________________________________ >> jgrapht-users mailing list >> jgr...@li... >> https://lists.sourceforge.net/lists/listinfo/jgrapht-users >> > > > > -- > Redder > > > > -- Redder |
From: Neal L. <im...@gm...> - 2011-02-22 05:25:32
|
I ran into a problem with using the grammatical relations between nodes as the edges and words as the nodes. I have tried with a Simple Graph, MultipGraph, and PseudoGraph. I implemented it in this fashion : public class DependencyGraph extends SimpleGraph<TreeGraphNode, GrammaticalRelation> public DependencyGraph(ArrayList<TypedDependency> tdl ) { super(GrammaticalRelation.class); this.tdl = tdl; this.tree =null; //build dependency graph from tdl; for (TypedDependency td : tdl) { this.addVertex(td.gov()); this.addVertex(td.dep()); this.addEdge(td.gov(), td.dep(), td.reln()); } } This works great because I can just grab the edge between to TreeGraphNodes and understand the relationship. However, Because this is perhaps a SimpleGraph (or Multigraph, or PseudoGraph), it will not lot me have more than on grammatrical relation edge (I imagine it would be the same if I used Strings as the edge types). Even though the edge is named "amod", if there are more than one "amod" relationships in the the typedDependencyList, these graphs wont load them. I am converting the whole typedDependencyList to an undirectedGraph. So basically, I want to be able to have more than one edge of the same name, but with no cycles Is there a graph I can use that would make this work? Or should I just stick with the default edges? Thanks! Neal On 02/10/2011 08:10 PM, Neal Lewis wrote: > That's fantastic! I didn't realize this API was so flexible. Thanks > for an awesome API! > > -Neal > > On 02/10/2011 07:41 PM, Ricardo Redder wrote: >> Hi, >> >> From the sample in project page: >> http://nlp.stanford.edu/software/lex-parser.shtml#Sample >> >> I imagine the TypedDependencies are: >> det(rain-3, >> The-1) >> amod(rain-3, >> strongest-2) >> nsubj(shut-8, >> rain-3) >> ... >> >> >> >> >> And, by dependecy relations, I understand: det, amod, nsubj, etc.. >> >> So... if that's the case, you don't need to use the class DefaultEdge >> as a type for your edges or extend it, JGraphT is based on >> Generics... so you can use whatever class which is suitable for you... >> E.g.: >> >> SimpleGraph<String, String> graph = new SimpleGraph<String, >> String>(String.class); >> >> So you can add edges with the desired information: >> graph.addEdge("rain-3", "The-1", "det"); >> graph.addEdge("rain-3", "strongest-2", "amod"); >> graph.addEdge("shut-8", "rain-3", "nsubj"); >> >> Probably your vertices and edges are not String's, so you just have >> to choose the right class for your graphs... >> I hope I could help you. >> >> Regards >> >> 2011/2/9 Neal Lewis <im...@gm... <mailto:im...@gm...>> >> >> Hello, >> >> First off, thanks for such a great API. This had made my life much, >> much easier. >> >> I am applying the graphs to output from the Stanford Parser API, and >> creating SimpleGraphs Undirected from the TypedDependencies >> output from >> the Stanford Parser. I would like to use the dependency relations as >> edges in the graph, such that I can create a GraphPath of label >> edges. >> >> Is this possible? Has it been down before? >> >> Thank you! >> >> Neal >> >> ------------------------------------------------------------------------------ >> The ultimate all-in-one performance toolkit: Intel(R) Parallel >> Studio XE: >> Pinpoint memory and threading errors before they happen. >> Find and fix more than 250 security defects in the development cycle. >> Locate bottlenecks in serial and parallel code that limit >> performance. >> http://p.sf.net/sfu/intel-dev2devfeb >> _______________________________________________ >> jgrapht-users mailing list >> jgr...@li... >> <mailto:jgr...@li...> >> https://lists.sourceforge.net/lists/listinfo/jgrapht-users >> >> >> >> >> -- >> Redder > |
From: John S. <js...@gm...> - 2011-02-22 02:46:32
|
This is due to a regression which slipped into the last release. The fix is already in svn, and will be included in the next release. JVS On Mon, Feb 21, 2011 at 6:40 PM, Aleksandar Dimitrov <ale...@go...> wrote: > Dear jgrapht users and devs, > > I believe I've hit a bug, but maybe it's just me overlooking something in the > docs or my own code. > > I would like to render my graphs to the DOT format, with labelled arcs and > vertices. However, every time I attempt to do that, I receive a Null pointer > exception from jgrapht: > >> Caused by: java.lang.NullPointerException >> at org.jgrapht.ext.DOTExporter.renderAttributes(Unknown Source) >> at org.jgrapht.ext.DOTExporter.export(Unknown Source) > > The code for my dotexporter looks something like this: > > >> final DOTExporter<String,String> dotex = new DOTExporter<String,String> >> ( new IntegerNameProvider<String>() >> , new VertexNameProvider<String>() { private int i = 0; >> public String getVertexName(String t) { i++;return i+t; } } >> , null); > > The integer variable is there to guarantee uniqueness. The documentation for > StringVertexNameProvider<V> seemed to require .toString of V to generate > something unique. I'm familiar with the DOT language, and I believe this would > only be relevant for the unique ID (which, in my case, IntegerNameProvider > covers well.) I did leave it in, though, since I only intend the graphs to be > used for debugging. But they're complex graphs, I'd like to see them properly > displayed. > > The above code is running *inside* an Apache UIMA analysis engine. I doubt that > this would have anything to do with the error. Removing the VertexNameProvider > and substituting null for it works. The same happens with the EdgeNameProvider. > > I'm using the version jgrapht-jdk1.6-0.8.2 (at least, that's what my JAR file is > called :-) > > I know that this is painfully little debugging information, and I haven't yet > isolated a runnable minimal case. Unfortunately, I'm rather busy today, and > probably tomorrow. I'll try to provide further information if needed to > reproduce the problem later this week. > > Thank you in advance (and for writing a really neat library!) > Aleks > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iQEcBAEBAgAGBQJNYyIHAAoJECmWntURB2vS/g4H/jrnOTAiYLSeNl0mSdmO7sj7 > S00pVJTXBYtfMEJteODG3M7dv1YiuCL9zber+0wX6u5dAzrlAUOnUxsygrB2AtGG > 1U50SDPc/1MGFeofElwo/REfrQcGczpJOwK6l5A9j0+S1P2IVMbuysNhQRpEU6Ea > y9D9O+AEFtyG9SJfJw8l6o7ibbc8rnJzV6aSggEsVMi5Vu1wbVbq3mB1023u88pK > lHFBcx9ZPLX7HfhBBvBbXQSZF88faw9Yyvzn0JMBwKw+m2S4yIAalUO2ZkFMQWys > wA1pDmrZyUsi4Mgpv4PL5brpQfr830BMNUsU2vF+eGYF9//0IrpB71ylE6Pv3mg= > =NJel > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------------ > Index, Search & Analyze Logs and other IT data in Real-Time with Splunk > Collect, index and harness all the fast moving IT data generated by your > applications, servers and devices whether physical, virtual or in the cloud. > Deliver compliance at lower cost and gain new business insights. > Free Software Download: http://p.sf.net/sfu/splunk-dev2dev > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > |
From: Aleksandar D. <ale...@go...> - 2011-02-22 02:40:57
|
Dear jgrapht users and devs, I believe I've hit a bug, but maybe it's just me overlooking something in the docs or my own code. I would like to render my graphs to the DOT format, with labelled arcs and vertices. However, every time I attempt to do that, I receive a Null pointer exception from jgrapht: > Caused by: java.lang.NullPointerException > at org.jgrapht.ext.DOTExporter.renderAttributes(Unknown Source) > at org.jgrapht.ext.DOTExporter.export(Unknown Source) The code for my dotexporter looks something like this: > final DOTExporter<String,String> dotex = new DOTExporter<String,String> > ( new IntegerNameProvider<String>() > , new VertexNameProvider<String>() { private int i = 0; > public String getVertexName(String t) { i++;return i+t; } } > , null); The integer variable is there to guarantee uniqueness. The documentation for StringVertexNameProvider<V> seemed to require .toString of V to generate something unique. I'm familiar with the DOT language, and I believe this would only be relevant for the unique ID (which, in my case, IntegerNameProvider covers well.) I did leave it in, though, since I only intend the graphs to be used for debugging. But they're complex graphs, I'd like to see them properly displayed. The above code is running *inside* an Apache UIMA analysis engine. I doubt that this would have anything to do with the error. Removing the VertexNameProvider and substituting null for it works. The same happens with the EdgeNameProvider. I'm using the version jgrapht-jdk1.6-0.8.2 (at least, that's what my JAR file is called :-) I know that this is painfully little debugging information, and I haven't yet isolated a runnable minimal case. Unfortunately, I'm rather busy today, and probably tomorrow. I'll try to provide further information if needed to reproduce the problem later this week. Thank you in advance (and for writing a really neat library!) Aleks |
From: Neal L. <im...@gm...> - 2011-02-11 04:10:30
|
That's fantastic! I didn't realize this API was so flexible. Thanks for an awesome API! -Neal On 02/10/2011 07:41 PM, Ricardo Redder wrote: > Hi, > > From the sample in project page: > http://nlp.stanford.edu/software/lex-parser.shtml#Sample > > I imagine the TypedDependencies are: > det(rain-3, The-1) > amod(rain-3, strongest-2) > nsubj(shut-8, rain-3) > ... > > > And, by dependecy relations, I understand: det, amod, nsubj, etc.. > > So... if that's the case, you don't need to use the class DefaultEdge > as a type for your edges or extend it, JGraphT is based on Generics... > so you can use whatever class which is suitable for you... > E.g.: > > SimpleGraph<String, String> graph = new SimpleGraph<String, > String>(String.class); > > So you can add edges with the desired information: > graph.addEdge("rain-3", "The-1", "det"); > graph.addEdge("rain-3", "strongest-2", "amod"); > graph.addEdge("shut-8", "rain-3", "nsubj"); > > Probably your vertices and edges are not String's, so you just have to > choose the right class for your graphs... > I hope I could help you. > > Regards > > 2011/2/9 Neal Lewis <im...@gm... <mailto:im...@gm...>> > > Hello, > > First off, thanks for such a great API. This had made my life much, > much easier. > > I am applying the graphs to output from the Stanford Parser API, and > creating SimpleGraphs Undirected from the TypedDependencies > output from > the Stanford Parser. I would like to use the dependency relations as > edges in the graph, such that I can create a GraphPath of label edges. > > Is this possible? Has it been down before? > > Thank you! > > Neal > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel > Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > <mailto:jgr...@li...> > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > > > > -- > Redder |
From: Ricardo R. <ric...@gm...> - 2011-02-11 03:42:00
|
Hi, >From the sample in project page: http://nlp.stanford.edu/software/lex-parser.shtml#Sample <http://nlp.stanford.edu/software/lex-parser.shtml#Sample>I imagine the TypedDependencies are: det(rain-3, The-1) amod(rain-3, strongest-2) nsubj(shut-8, rain-3) ... And, by dependecy relations, I understand: det, amod, nsubj, etc.. So... if that's the case, you don't need to use the class DefaultEdge as a type for your edges or extend it, JGraphT is based on Generics... so you can use whatever class which is suitable for you... E.g.: SimpleGraph<String, String> graph = new SimpleGraph<String, String>(String.class); So you can add edges with the desired information: graph.addEdge("rain-3", "The-1", "det"); graph.addEdge("rain-3", "strongest-2", "amod"); graph.addEdge("shut-8", "rain-3", "nsubj"); Probably your vertices and edges are not String's, so you just have to choose the right class for your graphs... I hope I could help you. Regards 2011/2/9 Neal Lewis <im...@gm...> > Hello, > > First off, thanks for such a great API. This had made my life much, > much easier. > > I am applying the graphs to output from the Stanford Parser API, and > creating SimpleGraphs Undirected from the TypedDependencies output from > the Stanford Parser. I would like to use the dependency relations as > edges in the graph, such that I can create a GraphPath of label edges. > > Is this possible? Has it been down before? > > Thank you! > > Neal > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > -- Redder |
From: Neal L. <im...@gm...> - 2011-02-09 16:59:18
|
Hello, First off, thanks for such a great API. This had made my life much, much easier. I am applying the graphs to output from the Stanford Parser API, and creating SimpleGraphs Undirected from the TypedDependencies output from the Stanford Parser. I would like to use the dependency relations as edges in the graph, such that I can create a GraphPath of label edges. Is this possible? Has it been down before? Thank you! Neal |
From: John S. <js...@gm...> - 2011-01-20 22:04:18
|
Hi folks, Via email, I got a contribution of a new shortest-path algorithm. I don't have a lot of background on its provenance, so for now I'm uploading it to the patch system. If someone (in particular someone with Russian-language skills) wants to do some more research on it and help get it ready for submission, that would be great. Thanks, JVS ---------- Forwarded message ---------- From: SourceForge.net <no...@so...> Date: Thu, Jan 20, 2011 at 2:00 PM Subject: [ jgrapht-Patches-3163001 ] LevitShortestPath To: no...@so... Patches item #3163001, was opened at 2011-01-20 14:00 Message generated for change (Tracker Item Submitted) made by perfecthash You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=579689&aid=3163001&group_id=86459 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Priority: 5 Private: No Submitted By: John V Sichi (perfecthash) Assigned to: Nobody/Anonymous (nobody) Summary: LevitShortestPath Initial Comment: Submitted by Oleg A. Morozov via email, with a link to this reference in Russian: http://rain.ifmo.ru/cat/view.php/vis/graph-paths/levit-2002/algorithm Like Dijkstra, assumes non-negative edge weights. Needs some work before commit: * reformat code and review data structures used * add unit tests (at a minimum, reuse some of the existing shortest path tests) * get some more background on the algorithm's computation complexity and use cases for which it is best-suited ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=579689&aid=3163001&group_id=86459 |
From: mjaved <mj...@co...> - 2011-01-18 11:37:37
|
Hi, i am creating a graph using DirectedGraph<GraphNode, GraphEdge> g = new DefaultDirectedGraph<GraphNode, GraphEdge>(GraphEdge.class); GraphNode and GraphEdge are my own generated classes which contain a number of datas which i would like to add with the nodes in graph. when i export it using GraphMLExporter.export(FileWriter fout, g); it doesn't store the data of nodes, it simply create empty nodes and edges. any help ???? Thanks Javed PhD Researcher www.cngl.ie -- View this message in context: http://jgrapht-users.107614.n3.nabble.com/GraphML-Exporter-doesn-t-work-properly-tp2279354p2279354.html Sent from the jgrapht-users mailing list archive at Nabble.com. |
From: Muhammad J. <mj...@co...> - 2011-01-17 14:39:00
|
Hi ya, I was looking into sampe code LabeledEdges. It add labels to the edges and nodes.... but when it is exported into a dot files, there are no lables with it. that means, we cannot import a dot file back and read this data ? Am i right ? -- Kind regards Muhammad Javed ** * Muhammad Javed, PhD Research Student, Centre for Next Generation Localisation, School of Computing, Dublin City University, Dublin 9, Ireland Tel: +353 (0)1 700 6912 Fax: +353 (0)1 700 6702 Web: www.computing.dcu.ie/~mjaved * |
From: Muhammad J. <mj...@co...> - 2011-01-14 10:51:04
|
Hi All, Can I import a .dot file in JGraphT I want to import it and then do some searching in the vertex and edges of the graph. my graph contains, labelled graph nodes and edges. is it possible? -- Kind regards Muhammad Javed ** * Muhammad Javed, PhD Research Student, Centre for Next Generation Localisation, School of Computing, Dublin City University, Dublin 9, Ireland Tel: +353 (0)1 700 6912 Fax: +353 (0)1 700 6702 Web: www.computing.dcu.ie/~mjaved * |
From: mjaved <mj...@co...> - 2011-01-13 13:59:36
|
Hi ya, i me new to JgraphT, 1- I don't know how to add labels on the Vertex and Edges, 2- How to save different attributes with one single Vertex. I am trying to generate an Attributed Typed Graph. thanks for your help in advance. Muhammad Javed PhD Researcher CNGL (www.cngl.ie) -- View this message in context: http://jgrapht-users.107614.n3.nabble.com/How-to-Add-Label-to-Vertex-or-any-Edge-tp2248236p2248236.html Sent from the jgrapht-users mailing list archive at Nabble.com. |
From: Atul S. <ha...@li...> - 2011-01-11 10:55:37
|
Hi, I am new to jgrapht library I need help retated to this issue: I require to fing Minimum Spanning tree from a undirected wieghted graph. But not able to understand which graph class i should use and how? Please tell Is "simplewieghtedgraph" class work as directed or undirected in KruskalMST class. What is with this "AsWeightedGraph<V,E>"? and how to use it for my task? Thanx in advance ------------------------------- Atul Saroha@IIT Kanpur |
From: Federico F. <fed...@gm...> - 2011-01-10 11:05:28
|
Hi all, suppose that I have a graph g2, and I get the set of all edges, e.g.: Set es = g2.edgeSet(); I tried to print the edges, via the routine: Iterator itEdge = es.iterator(); while (itEdge.hasNext()){ Edge de = (Edge) itEdge.next(); System.out.println(" next edge "+de.toString()); } and I get all "null" as printed values, although es.size() does return the correct number of edges. Is there a way to list all the edges correctly ? Many thanks, Federico |
From: seham m. <ss_...@ya...> - 2011-01-10 07:07:30
|
Dear Sir, I am now making a parser code for XSD documents. the results should be put in a tree data structure. Could you give me an implementation of a tree data structure such that it contains the following function: 1. every node can have more than one data item, a function to put that in a node. 2. every parent has any number of children (We build the tree from the parsing). 3. we can preorder and postorder the tree. 4. delete a node and get its parent[ to make a post order and delete the nodes one per one starting at the 1st node in the preorder and delete it and then get its parent] then put the nodes in an arraylist and the parents in another arraylist. 5. get siblings of the node. 6. get the ancestor path of any node 7. get the descendent path of any node 8. get the parent of any node This is what I want to do? may be there are other functions. CAN YOU HELP ME? (in Java code, please) Thanks \Seham |