[FIXED] Showing curved edges in a weighted directed graph?

Once it's running
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
aplume
Posts:6
Joined:14 Jul 2010 12:03
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[FIXED] Showing curved edges in a weighted directed graph?

Post by aplume » 14 Jul 2010 12:12

Hi all,

I am very new to graph theory and network visualisation so I hope you will forgive me if there an obvious misunderstanding here on my part, or a simple and apparently obvious way to do this!

I am trying to visualise a simple directed network (I think!) connected by two edges per node as shown at the bottom of this message. When I visualise with the Force Atlas algorithm and display the edges as curved edges, the ones connecting for example Canada and the US are the same thickness, while one should be about 5 times thicker than the other (indicating an assymetrical relationship between these two countries).

:?: Is there a way to have the graph show these bidirectional curved edges between two given nodes with their appropriate weights?

Much appreciation for any guidance you can offer!

Andrew

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<gexf xmlns="http://www.gexf.net/1.1draft" version="1.1">
<meta lastmodifieddate="2009-03-20">
<creator>Gexf.net</creator>
<description>First test of manually encoded data</description>
</meta>
<graph mode="static" defaultedgetype="directed">
<nodes>
<node id="Canada" label="Canada"/>
<node id="France" label="France"/>
<node id="Germany" label="Germany"/>
<node id="Italy" label="Italy"/>
<node id="Japan" label="Japan"/>
<node id="United Kingdom" label="United Kingdom"/>
<node id="United States" label="United States"/>
</nodes>
<edges>
<edge id="0" source="Canada" target="Canada" weight="1"/>
<edge id="0" source="Canada" target="United States" weight="0.1940814"/>
<edge id="0" source="Canada" target="United Kingdom" weight="0.05427539"/>
<edge id="0" source="Canada" target="France" weight="0.03898933"/>
<edge id="0" source="Canada" target="Germany" weight="0.03849978"/>
<edge id="0" source="Canada" target="Japan" weight="0.02061038"/>
<edge id="0" source="Canada" target="Italy" weight="0.01953261"/>
<edge id="0" source="France" target="France" weight="1"/>
<edge id="0" source="France" target="United States" weight="0.1077264"/>
<edge id="0" source="France" target="Germany" weight="0.0728741"/>
<edge id="0" source="France" target="United Kingdom" weight="0.07065262"/>
<edge id="0" source="France" target="Italy" weight="0.05412602"/>
<edge id="0" source="France" target="Canada" weight="0.03214583"/>
<edge id="0" source="France" target="Japan" weight="0.02109785"/>
<edge id="0" source="Germany" target="Germany" weight="1"/>
<edge id="0" source="Germany" target="United States" weight="0.1216888"/>
<edge id="0" source="Germany" target="United Kingdom" weight="0.06792334"/>
<edge id="0" source="Germany" target="France" weight="0.05264217"/>
<edge id="0" source="Germany" target="Italy" weight="0.03914655"/>
<edge id="0" source="Germany" target="Canada" weight="0.02292966"/>
<edge id="0" source="Germany" target="Japan" weight="0.02178827"/>
<edge id="0" source="Italy" target="Italy" weight="1"/>
<edge id="0" source="Italy" target="United States" weight="0.1140013"/>
<edge id="0" source="Italy" target="United Kingdom" weight="0.07024939"/>
<edge id="0" source="Italy" target="Germany" weight="0.06835502"/>
<edge id="0" source="Italy" target="France" weight="0.06827214"/>
<edge id="0" source="Italy" target="Canada" weight="0.02031312"/>
<edge id="0" source="Italy" target="Japan" weight="0.01573507"/>
<edge id="0" source="Japan" target="Japan" weight="1"/>
<edge id="0" source="Japan" target="United States" weight="0.08040417"/>
<edge id="0" source="Japan" target="Germany" weight="0.0216889"/>
<edge id="0" source="Japan" target="United Kingdom" weight="0.02057521"/>
<edge id="0" source="Japan" target="France" weight="0.01517098"/>
<edge id="0" source="Japan" target="Canada" weight="0.01221913"/>
<edge id="0" source="Japan" target="Italy" weight="0.008970295"/>
<edge id="0" source="United Kingdom" target="United Kingdom" weight="1"/>
<edge id="0" source="United Kingdom" target="United States" weight="0.1173371"/>
<edge id="0" source="United Kingdom" target="Germany" weight="0.06280775"/>
<edge id="0" source="United Kingdom" target="France" weight="0.04719359"/>
<edge id="0" source="United Kingdom" target="Italy" weight="0.03720145"/>
<edge id="0" source="United Kingdom" target="Canada" weight="0.02989074"/>
<edge id="0" source="United Kingdom" target="Japan" weight="0.01911277"/>
<edge id="0" source="United States" target="United States" weight="1"/>
<edge id="0" source="United States" target="United Kingdom" weight="0.03615102"/>
<edge id="0" source="United States" target="Germany" weight="0.0346681"/>
<edge id="0" source="United States" target="Canada" weight="0.03293082"/>
<edge id="0" source="United States" target="Japan" weight="0.0230114"/>
<edge id="0" source="United States" target="France" weight="0.02216981"/>
<edge id="0" source="United States" target="Italy" weight="0.01859997"/>
</edges>
</graph>
</gexf>
Last edited by aplume on 14 Jul 2010 15:46, edited 1 time in total.

User avatar
MrPok
Posts:18
Joined:08 Jul 2010 11:09
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Showing curved edges in a weighted directed graph?

Post by MrPok » 14 Jul 2010 14:11

Hi Andrew,

I've also just recently started out working with Gephi, so I don't mind sharing my experiences so far -- your questions help everybody improving Gephi! :D

I have saved your gexf network and loaded it into Gephi. (see my post signature for my specs)

From your description I can't really reproduce your problem, when I've ran layout Force Atlas:
  • In the Overview window, with (default) straight edges I do see that the edge(Canada,US) is much thicker than edge(US,Canada). To easier see this difference: move the Edge Scale slider to a larger scale, you'll see that actually not all edges have the same thickness.
  • I wonder if you are looking at your network from the Overview or the Preview window, because in Overview I can't find any option that lets me set curved edges.
    -- mind you, I experience the Preview part of Gephi to be still quite buggy, so I would stick with the Overview part. Perhaps you've discovered a bug?
Can you pls tell us in which window you're working (Overview or Preview) and how you set those curved edges? That might lead us to the cause of your problem and hopefully a quick solution! ;)

Kind regards,
Paul

aplume
Posts:6
Joined:14 Jul 2010 12:03
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Showing curved edges in a weighted directed graph?

Post by aplume » 14 Jul 2010 14:19

Dear Paul,

Thank you very much for helping with this!

Yes, I am trying to view the network in Overview, since there I can get high-quality output files and also can use the curved edges for visual impact.

Have I found a bug? Can anyone with programming skills (of which I have none to offer!) help us with this?

Best,
Andrew

User avatar
MrPok
Posts:18
Joined:08 Jul 2010 11:09
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Showing curved edges in a weighted directed graph?

Post by MrPok » 14 Jul 2010 14:49

aplume wrote:Thank you very much for helping with this!
No problem, I have been receiving a lot of fast and useful feedback myself since I started out posting on these forums. By the way, can you pls edit your first post and place the code of your network between Code tags? (it's the button between Quote and List, above the text window when you type a post) That will keep your post more readable for people that want to help you! :idea:
aplume wrote:Yes, I am trying to view the network in Overview, since there I can get high-quality output files and also can use the curved edges for visual impact.
I think you mean the Preview window, right? The high-quality work is rendered in Preview, not in Overview, as far as I know.
aplume wrote:Have I found a bug? Can anyone with programming skills (of which I have none to offer!) help us with this?
  1. First we need to establish in which window you are having the problem.
  2. Now make sure that your Gephi has all updates installed; go to the menu "Help" and click on "Check for Updates". Install any updates that are available and afterwards check if you still experience problems.
  3. Next we will take a look at the list of currently filed bugs on the page: https://bugs.launchpad.net/gephi/+bugs? ... t_dupes=on
  4. If you can't find any bug there that fits the description of your problem, then either what you run into is:
  5. [list]
  6. indeed a yet undetected (or "unfiled") bug, or
  7. the developers consider it a feature and have intended for Gephi to work like this.
So in both cases you can file a bug report -- take a look at the wikipage: http://wiki.gephi.org/index.php/HowTo_report_a_bug
-- and the appropriate developers will respond![/list]

Good luck!
Paul

aplume
Posts:6
Joined:14 Jul 2010 12:03
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Showing curved edges in a weighted directed graph?

Post by aplume » 14 Jul 2010 15:49

Thanks for this!
My code is now clearly marked.
I am looking in Preview (not Overview) - sorry for my lack of clarity here!
Gephi is completely up-to-date - I always check and install all updates each time I start up.
This filed bug (https://bugs.launchpad.net/gephi/+bug/569329) sounds very like the problem I'm seeing. Can I 'second' this report?

Apologies again for my ignorance of how to go about this! I really do appreciate your help!

Andrew

User avatar
MrPok
Posts:18
Joined:08 Jul 2010 11:09
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Showing curved edges in a weighted directed graph?

Post by MrPok » 14 Jul 2010 16:39

aplume wrote:Thanks for this!
My code is now clearly marked.
Well done.
aplume wrote:I am looking in Preview (not Overview) - sorry for my lack of clarity here!
Gephi is completely up-to-date - I always check and install all updates each time I start up.
Me too ;) ok, so it must be something else that is causing this.
aplume wrote:This filed bug (https://bugs.launchpad.net/gephi/+bug/569329) sounds very like the problem I'm seeing. Can I 'second' this report?
It pretty much sounds like it yes. If I were you, I'd follow the steps in the HowTo_report_a_bug wiki that is, make a launchpad account if you haven't already. Then above the bug it will read "This bug affects 1 person. Does this bug affect you?" If you click that, you "second" it :)

Good luck and don't worry about the asking: at least you are willing to learn, right? ;)

Paul

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Showing curved edges in a weighted directed graph?

Post by mbastian » 27 Jul 2010 15:34

The problem is actually different, and concern mutual edges drawing on preview.

I created a new bug for that. As its a quite serious problem and I could fix the problem quicky, I fixed and deployed the patch today.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable