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
0
votes
0 answers

How to calculate the edge attributes as the path length in igraph?

Pretend the dataframe below is an edgelist (relation between inst2 and motherinst2), and that km is an attribute I want to calculate as a path that's been assigned to the edges. I'm too new at coding to make a reproducible edge list. inst2 = c(2, 3,…
hmnoidk
  • 441
  • 6
  • 13
0
votes
2 answers

Converting an edge list to an incidence matrix using in bipartite matrices

I have an edge list like this a 1 b 2 c 3 a 2 b 1 and I want to build it's incidence matrix which would be like: a b c d 1 1 1 0 0 2 1 1 0 0 3 0 0 1 0 4 0 0 0 0 Any idea to do it?
minoo
  • 451
  • 4
  • 18
0
votes
1 answer

How to access vertices via edge list iteration igraph R

I am trying to access the vertices of each vertex pair in an edge using a for loop like this: for (e in E(G)) { do stuff } However, I don't know how to get each vertex in e. I am trying to return the type of each vertex, which is in the vertex…
xjtc55
  • 289
  • 2
  • 4
  • 12
0
votes
2 answers

Why graph doesn't find correct path?

I've tried to create graph with the help of the following link but when I used find_path method I got incorrect path returned. Link: http://www.python-course.eu/graphs_python.php Code: class Graph(object): def __init__(self, graph_dict=None): …
Hsin
  • 177
  • 3
  • 11
0
votes
1 answer

How to select edge randomly from graph in R?

I have a regular graph and wanna delete randomly edge from graph. How to select edges randomly till I can delete? library(igraph) g = sample_k_regular(10,3)
ParisaN
  • 711
  • 7
  • 39
0
votes
1 answer

Apache Giraph: Cannot modify edge value via setEdgeValue()

This code is borrowed from the book "Practical Graph Analytics with Apache Giraph". My code's goal is to transform a graph from using only one-direction edge into using two-direction edges. My data is a tab-delimited text file to…
Marc Kees
  • 156
  • 2
  • 12
0
votes
3 answers

Implement an Indirect Connectivity Test for Java Graph class

I'm writing a class in Java to represent a Graph data structure. This is specific to an undirected, unweighted graph and it's purpose is mainly for edge testing (is node A connected to node B, either directly or indirectly). I need help…
dvanaria
  • 6,073
  • 21
  • 58
  • 77
0
votes
1 answer

How can I cut a tree into two by removing an edge?

My goal is for the removal of an edge from a given tree T will result in the formation of two separate trees, T1 and T2. Each vertex of the tree T is assigned a positive integer. My task is to remove an edge, such that the Tree_diff of the resultant…
coder101
  • 770
  • 2
  • 9
  • 25
0
votes
1 answer

How to customize the edges in networkx?

I want to make some customize edges in networkx. These edges should be like those on the column labeled as symbol of the following table (excepting the 13 row): Anyone can please give some clues in how to build it? Thanks in advance! UPDATE 1:…
Ivan Castro
  • 441
  • 1
  • 6
  • 21
0
votes
2 answers

Creating edge list with additional variables in R

I have data like this: ID=c(rep("ID1",3), rep("ID2",2), "ID3", rep("ID4",2)) sex=c(rep("male",3), rep("female",2), "female", rep("male",2)) item=c("a","b","c","a","c","a","b","a") df1 <- data.frame(ID,sex,item) df1 ID sex item 1 ID1 male …
ElinaJ
  • 731
  • 1
  • 6
  • 17
0
votes
1 answer

Extracting nodes form dotted list (edges) in CLISP

I'm a "Nil" or () in Lisp World. I wanted to get a list of all nodes in edge list and I wrote a code to solve this problem. But I met some unexpected problem. (Codes from 'Land of Lisp' - chapter 8) ;; Creating edge list (defun random-node () …
Larynx
  • 337
  • 1
  • 12
0
votes
1 answer

To find number of patterns

For a dataset like: 21 79 78 245 21 186 65 522 4 21 3 4 4 212 4 881 124 303 28 653 28 1231 7 464 7 52 17 102 16 292 65 837 28 203 28 1689 136 2216 7 1342 56 412 I need to find the number of associated patterns. For example…
phoenix
  • 335
  • 1
  • 3
  • 17
0
votes
1 answer

Why Gephi hides most of edges on graph?

I have a csv file with graph formatted as edge list, ie Source, Target, Label, Type (Directed), Weight (all weights = 1) It consist of 31900 edges as i checked in Data laboratory. Then i go to view my graph and in the Context (right top corner of…
Vic Nicethemer
  • 1,011
  • 2
  • 14
  • 36
0
votes
1 answer

Weighted Relative Graph on 2D Coordinate System

Given a graph of nodes and weighted edges between these nodes, such that the placement of each node is relative to other nodes in the graph, what is a good library (python preferred) to visualize these nodes with the weighted edges enforced? Lastly,…
0
votes
1 answer

Gathering column names from data frame into a list in R

so I have a working data frame right now, but I would like to study the origins of the subjects of the data frame. Here is some of the code I used to create the data frame: df <- as.data.frame(t(test)) #This is so the row names are products …
James
  • 39
  • 8