Re: [jgrapht-users] Limited edges number?
Brought to you by:
barak_naveh,
perfecthash
From: Rushang K. <rus...@ho...> - 2015-01-19 00:30:15
|
I am not sure if this is the solution but does JGraphT provide another identification for an Edge. Say addEdge(V a, V b) addEdge(V a, V b, E) where E is the type of edge? addEdge(V a, V b) will add an edge only if there does not exist an edge in the graph already with those objects. Integer a = 42; Integer b = 50; (add the constructors) addEdge(a, b) will add an edge. Now if you do a = 100; b = 40; addEdge(a,b) it will not add the edge. I would try using the second type of method. String x = "" for total number of edges { addEdge(a, b, x) x += " "; } I would first see if this fixes the problem. If yes then the problem is that your object references are not changing. Again I do not remember clearly( Long time since I used jgrapht) From: jul...@gm... Date: Sun, 18 Jan 2015 11:17:15 -0500 To: bor...@gm... CC: jgr...@li... Subject: Re: [jgrapht-users] Limited edges number? Hi Boris, I'd take a guess that you're using Integer objects to identify nodes, and being caught by Java's curious habit of autoboxing Integers up to 127 only. See this reference: http://bexhuff.com/2006/11/java-1-5-autoboxing-wackyness. This wouldn't explain why your limit is 50 and not 127, but there may be some arithmetic jiggery-pokery in your code that pushes some important integer into the 127 / 128 range. My apologies if you're my grandmother and you already know how to suck eggs. Julian Tuck On Fri, Jan 16, 2015 at 9:07 AM, Bartek Borucki <bor...@gm...> wrote: Hi,I've creating an Android project using JgraphT. It works fine except one thing, why can't I add more than 50 edges to WightedGraph like this: defaultWeightedEdge = (DefaultWeightedEdge) graph.addEdge(fromNode, toNode); ? Thanks in advance for all replies.Bartek ------------------------------------------------------------------------------ New Year. New Location. New Benefits. New Data Center in Ashburn, VA. GigeNET is offering a free month of service with a new server in Ashburn. Choose from 2 high performing configs, both with 100TB of bandwidth. Higher redundancy.Lower latency.Increased capacity.Completely compliant. http://p.sf.net/sfu/gigenet _______________________________________________ jgrapht-users mailing list jgr...@li... https://lists.sourceforge.net/lists/listinfo/jgrapht-users ------------------------------------------------------------------------------ New Year. New Location. New Benefits. New Data Center in Ashburn, VA. GigeNET is offering a free month of service with a new server in Ashburn. Choose from 2 high performing configs, both with 100TB of bandwidth. Higher redundancy.Lower latency.Increased capacity.Completely compliant. http://p.sf.net/sfu/gigenet _______________________________________________ jgrapht-users mailing list jgr...@li... https://lists.sourceforge.net/lists/listinfo/jgrapht-users |