Limited edges number?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Limited edges number?

Bartek Borucki
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users
Reply | Threaded
Open this post in threaded view
|

Re: Limited edges number?

H.N. de Ridder
On Fri, Jan 16, 2015 at 03:07:20PM +0100, Bartek Borucki wrote:

> 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); ?

Out of memory maybe? What's the error and what does your code look like?


--
Information System on Graph Classes and their Inclusions (ISGCI)
http://www.graphclasses.org

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users
Reply | Threaded
Open this post in threaded view
|

Re: Limited edges number?

Julian Tuck
In reply to this post by Bartek Borucki
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 <[hidden email]> 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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users
Reply | Threaded
Open this post in threaded view
|

Re: Limited edges number?

Rushang Karia
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: [hidden email]
Date: Sun, 18 Jan 2015 11:17:15 -0500
To: [hidden email]
CC: [hidden email]
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 <[hidden email]> 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
[hidden email]
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 [hidden email] 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jgrapht-users