0

I use igraph and my input has some nodes with identical data. I use the euclidean distance as weights for my graph, so for these nodes the weight will be zero. Afterwards, I call the Leading Eigenvector algorithm and it produces the graph. The nodes which are identical appear in the middle of the graph, but not in the same place and I don't understand how they are ordered.

Are there some criteria for the order of these nodes on the graph?

I give you a subset of my data, as an example below.

Example of input data:

sample data

My nodes are x1, x2,...x4, where x1 and x2 have the same data.

After calculating Euclidean distance with function dist, I get the distance table which I convert to matrix ed2 and use it as my weights for the graph, which is produced as follows:

g <- graph_from_data_frame(relations, directed=FALSE, vertices=nodes) where nodes are x1 to x4 and relations are all possible relationships between them.

E(g)$weight =ed2; #here I put the weights

Thanks in advance!

  • 1
    Welcome to StackOverflow. In order to ask a better question please read [How to ask a good question](https://stackoverflow.com/help/how-to-ask) and [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve) and [How to make a great R reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Rui Barradas Jan 24 '20 at 09:12
  • Can you post sample code and data? Please edit **the question** with the output of `dput(df)`. Or, if it is too big with the output of `dput(head(df, 20))`. (`df` is the name of your dataset.) – Rui Barradas Jan 24 '20 at 09:13

0 Answers0