edge weight = edge length

Algorithms and parameters to put data in space
Post Reply
garethayres
Posts: 1
Joined: 11 Apr 2012 16:46

edge weight = edge length

Post by garethayres » 12 Apr 2012 12:47

Hi, im new to Gephi but im trying to make graphs where the edge weight represents the length between nodes.

I searched and read that the Force Atlas uses the edge weight as a factor towards edge length. But the lower the edge weight the longer the edge length?

Also i would like the length to be a fixed value where possible, and move nodes to accommodate the edge lengths to neighbour nodes.

Im trying to get nodes to position themselves so that they are closer to neighbours using the edge weight, where edge weight of a larger value represents a larger distance.

Im not sure what is the best option for me? Or if Force Atlas is as good i as can get, if i inverse my edge weight values?

Thanks,
Gareth.

admin
Gephi Community Manager
Posts: 964
Joined: 09 Dec 2009 14:41

Re: edge weight = edge length

Post by admin » 12 Apr 2012 12:55

Hi,

Force-directed layouts works on the following principle: the stronger the relationship between two nodes, the closer they are. So edge weight is always considered as the "strength" of a relation: small weights means weaker relation so distant nodes, and large weights means stronger relation so closer nodes.

I am not aware of a layout about to position nodes with the exact formula "edge weight = edge length".

ryanefoley@gmail.com
Posts: 1
Joined: 22 Aug 2012 21:53

Re: edge weight = edge length

Post by ryanefoley@gmail.com » 22 Aug 2012 21:56

Edge weight represents the similarity between nodes, so higher similarity means smaller edge length. If you have lengths between nodes, then it sounds like they represent a dissimilarity. One trick to change a dissimilarity to a similarity and vice versa is to take its inverse. Hope that helps!

porezai
Posts: 2
Joined: 17 Jun 2014 03:52
Location: United States

Re: edge weight = edge length

Post by porezai » 17 Jun 2014 04:00

Hello,

I am trying to solve the same problem, in which I know the connectivity of a graph and the edge lengths. Any thoughts?

Thanks,
Pooya

User avatar
rotten
Posts: 34
Joined: 27 Aug 2010 14:42
Location: Columbus, Ohio

Re: edge weight = edge length

Post by rotten » 07 Jan 2015 00:05

I too am looking for a good way to do this. It looks like D3's force layout has both "edges" and "links", with links having some fixed length, so to some effect you can use D3 to get a hybrid force layout with a few nodes separated by planks instead of springs.

There are some physics-engine building games that have different types of connectors (collapsible, springy, and stiff) between objects as well.

In my scenario I'm looking at a small set of objects all of which must be certain distances (in the real world) from each other. I'd like to explore arrangements of those objects with those distance constraints in mind. I don't have a lot of nodes, so I don't need an automated layout at this time, but I would like to drag the nodes around with rigid edges to see how they can be arranged.

I'm not convinced you can always put a graph with fixed lengths between the nodes on a plane, but sometimes a tool like this would be handy none-the-less.

I don't see an answer to this problem with Gephi any time soon, but it is something that comes up every now and then so I thought I'd mention it again anyhow.

WouterSpekkink
Posts: 5
Joined: 04 Jun 2014 09:37

Re: edge weight = edge length

Post by WouterSpekkink » 25 Mar 2015 13:28

I'm not sure if people are still following this post. The problem that you are addressing is actually quite challenging, because it is not always possible to position a larger number of nodes in a way that their respective distances (in terms of the weight of their relationships) are accurately represented in their layout. Say that you have three nodes: A, B, and C. Let's assume that the weight of their relationships represents their distance. If A and B have weight 10, A and C have weight 1, and B and C have weight 1 as well, then it is impossible to come up with a 2-dimensional layout that respects all these distances equally. A wants to be close to C and B also wants to be close to C, but A and C want to be far apart.

I recently wrote a duo of plugins for Gephi that use the path distances between nodes to determine their layout (MDS Statistics and MDS Layout) : the longer the path distances between two nodes, the further apart these nodes tend to be in the layout. It also allows you to take into account the weights of the edges between nodes (higher weights lead to shorter distances). The effect of this procedure is much the same as that of the Force Atlas 2 Layout. To some extent they are based on similar principles. However, the MDS analysis also gives you a measure of stress, which indicates how well the layout corresponds with the actual distances between the nodes. Thus, it would even be possible to come up with a layout for the example that I discussed above (with the A, B and C), but the layout would be associated with a high value of stress, which indicates that the layout is far from ideal given the actual distances. In the near future I plan to add an option to treat edge weights as distances (the higher the weight, the longer the distance). I think this will be interesting, for example, for networks where actual geographical distances between nodes are used as edge weights. This shouldn't taken much time to make. I think it's just a minor addition to the plugin as it already exists.

Peter22
Posts: 2
Joined: 30 Jun 2017 02:40

Re: edge weight = edge length

Post by Peter22 » 30 Jun 2017 13:31

WouterSpekkink wrote:
25 Mar 2015 13:28
I'm not sure if people are still following this post. The problem that you are addressing is actually quite challenging, because it is not always possible to position a larger number of nodes in a way that their respective distances (in terms of the weight of their relationships) are accurately represented in their layout. Say that you have three nodes: A, B, and C. Let's assume that the weight of their relationships represents their distance. If A and B have weight 10, A and C have weight 1, and B and C have weight 1 as well, then it is impossible to come up with a 2-dimensional layout that respects all these distances equally. A wants to be close to C and B also wants to be close to C, but A and C want to be far apart.

I recently wrote a duo of plugins for Gephi that use the path distances between nodes to determine their layout (MDS Statistics and MDS Layout) : the longer the path distances between two nodes, the further apart these nodes tend to be in the layout. It also allows you to take into account the weights of the edges between nodes (higher weights lead to shorter distances). The effect of this procedure is much the same as that of the Force Atlas 2 Layout. To some extent they are based on similar principles. However, the MDS analysis also gives you a measure of stress, which indicates how well the layout corresponds with the actual distances between the nodes. Thus, it would even be possible to come up with a layout for the example that I discussed above (with the A, B and C), but the layout would be associated with a high value of stress, which indicates that the layout is far from ideal given the actual distances. In the near future I plan to add an option to treat edge weights as distances (the higher the weight, the longer the distance). I think this will be interesting, for example, for networks where actual geographical distances between nodes are used as edge weights. This shouldn't taken much time to make. I think it's just a minor addition to the plugin as it already exists.
I have a concern similar to this topic so maybe you can help me out:

Is it possible to apply a layout (like the Fruchterman Reingold) and dictate the distance of any node to the center?

I have 25 different nodes, each of them has a value between 2 000 and 10 000 and I want the nodes with the higher values to be positioned closer to the center. (Theoretically they are all linked to the center (node), but I don't want these links to be shown)

So the forced layout should be applied to position the nodes evenly in a layout with the according distance to the center.

Additionally, all the 25 nodes are linked with different strenghts/weights to each other.Here higher edge values should lead to thicker edges between the nodes, the distance in terms of length of an edge between two nodes doesn't matter (position of nodes dictated in the first step should be kept!)

And is it then possible to set a cutoff value (weight>x) to only show edges with edge weights above the cutoff value?

Thanks in advance!

Peter

alexandramiller
Posts: 2
Joined: 21 Dec 2017 09:30

Re: edge weight = edge length

Post by alexandramiller » 21 Dec 2017 09:43

Hello All,

I am a PhD student researching the social organisation of a monkey supergroup.
I am trying to visualise a social network where I have the distance between all individuals (nodes).
I have 400 individuals and know the edge weight in distance between all individuals.
It is similar to the flight path network (with distance between airports) (however in those tutorials they use Latitude and Longitude in the node file) where i have:
Source Target Distance
indiv1 indiv2 7
indiv2 indiv3 14
indiv1 indiv400 7000

and the node file is:
ID Label Sex_Category
indiv1 1 AdultMale
indiv2 2 AdultFemale
indiv3 3 Juvenile

Would really appreciate some help if anyone can assist!
Best,
Alex

Post Reply