Questions tagged [edge-list]

Use [edge-list] for questions about creating, converting, or working in general with a list of edge nodes/vertices from a spatial network or graph. Be sure to include what language you are working with, e.g. [r].

An edge list is a list of edge nodes or vertices formatted in a tabular, graph, or other ordered layout. Sometimes referred to as an adjacency list or node list, an edge list contains all the points of a spacial network, commonly called a graph or map.

Edge lists in programming are used in R, Wolfram, and MATLAB, among others, and more broadly in computer science and mathematics in the specific fields of sorting/searching algorithms or graph traversal.

For further reading, see these links:

78 questions
22
votes
1 answer

How to change edges' weight by designated rule?

I have a weighted graph: F=nx.path_graph(10) G=nx.Graph() for (u, v) in F.edges(): G.add_edge(u,v,weight=1) Get the nodes list: [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8), (8, 9)] I want to change each edge's weight by…
Johnny
  • 221
  • 1
  • 2
  • 4
16
votes
1 answer

How can I generate rectangle style edges instead of curves in GraphViz?

I have generated Graphviz images with the dot language using the Pydot Python library. But the edges are getting draw in curves, and I need this kind of output: Please provide a solution using Graphviz.
Yatin Kumbhare
  • 254
  • 2
  • 3
  • 6
13
votes
3 answers

How to create an edge list from a matrix in R?

The relationship is expressed as a matrix x like this: A B C D A 0 2 1 1 B 2 0 1 0 C 1 1 0 1 D 1 0 1 0 The entries refer to the number of connections they have. Could anyone…
user1787675
  • 1,061
  • 2
  • 12
  • 12
11
votes
2 answers

Import weighted edgelist using igraph

I have the following txt file representing a network in edgelist format. The first two columns represent the usual: which node is connected to which other nodes The third column represents weights, representing the number of times each node has…
user1723765
  • 5,639
  • 15
  • 51
  • 81
7
votes
1 answer

ArangoDB Import csv to edge (Graph)

I have a csv file that I want to import into a graph in ArangoDB. I'm using ArangoDB3-3.1.24 community version. Here are the first three rows of the csv file…
Muna arr
  • 343
  • 1
  • 12
6
votes
1 answer

Extract edge and communities from list of nodes

I have dataset which has more than 50k nodes and I am trying to extract possible edges and communities from them. I did try using some graph tools like gephi, cytoscape, socnet, nodexl and so on to visualize and identify the edges and communities…
Sitz Blogz
  • 927
  • 5
  • 23
  • 46
5
votes
3 answers

Creating edge list in R

I have data like this: ID=c(rep("ID1",3), rep("ID2",2), "ID3", rep("ID4",2)) item=c("a","b","c","a","c","a","b","a") data.frame(ID,item) ID1 a ID1 b ID1 c ID2 a ID2 c ID3 a ID4 b ID4 a and I would need it as a list of edges like…
ElinaJ
  • 731
  • 1
  • 6
  • 17
4
votes
1 answer

Minimizing the maximum distance in a graph

Let's say we have a weighted undirected graph. Assume there are N nodes(cities) in the graph and we want to build M (M<=N) hospitals in the city. Now we need to choose the most optimal solution, such that the maximum distance from a city to a city…
Stefan4024
  • 674
  • 1
  • 10
  • 21
4
votes
2 answers

Edge Collection vs. Graph

There's one thing I don't get in ArangoDB: What's the difference between an edge collection and a graph? In which cases should I choose which?
Mr.Yeah
  • 852
  • 1
  • 7
  • 19
3
votes
1 answer

How to extract unique and double records by row while keeping original row order using R?

Original (see Update below) I'm a newbie to R and currently working with collaboration data in the form of an edge list with 32 columns and around 200.000 rows in the following representation: 1 A A A B C A 2 A B B B C …
Seb
  • 179
  • 8
3
votes
2 answers

Get edge list that includes alter's alters

I need a data frame that includes three columns: i, j (alter), and k (j's alter). I have an adjacency matrix (sample below). From there I can get a graph object and extract the edge list. How can I manipulate the data to get an output like the WANT…
L. Tucker
  • 375
  • 1
  • 10
3
votes
1 answer

How to prevent edge labels from messing up the layout in graphviz?

I have a simple vertical graph that looks nice and symmetrical without any labels using the following code: digraph test_alignment { {rank=same; a -> b;} a -> c; b -> c; c -> d; d -> e; d -> f; {rank=same; e ->…
Kefen
  • 73
  • 2
  • 8
2
votes
0 answers

How to transform dyadic matrix to edge list

I have a data like this Nominator Nominees1 Nominees2 School 1101 1104 1105 01 1102 1105 N/A 01 1103 1104 1105 01 1106 1107 N/A 02 1108 1107 1108 02 This is dyadic matrix. In each school, The Nominator have a connection with…
Nathan
  • 21
  • 1
2
votes
1 answer

Creating new edge list based on common vertices from bipartite network edge list

I have an edge list of two sets of nodes like so: edgelist <- data.frame(from = sample(letters, 1000, replace = T), to = sample(1:50, 1000, replace = T)) What I need is to do is to produce a graph for each of the sets on…
ayeh
  • 64
  • 8
2
votes
1 answer

Counting undirected edges between any two nodes

I'm trying to generate an edge list to feed into R's igraph plotting function, which requires that I generate a data.frame' objective consisting of two columns representing "from" node and "to" node with other columns serving as edge…
Chris T.
  • 1,181
  • 3
  • 17
  • 32
1
2 3 4 5 6