Questions tagged [lightgraphs]
22 questions
5
votes
1 answer
MetaGraphs load and save
How can I save and load a MetaGraph object from LightGraphs, and MetaGraphs, so that if I load the metagraph I still have the metadata?
Right now I have a metagraph mg that I save using:
LightGraphs.savegraph("net.lg", mg)
But trying to reload it…

A.Yazdiha
- 1,336
- 1
- 14
- 29
4
votes
3 answers
Generating a weighted and directed network form adjacency matrix in Julia
I want to generate a weighted and directed network from an adjacency matrix in Julia (v0.7).
So far I've tried:
using LightGraphs
using SimpleWeightedGraphs
A = rand(100, 100)
G = Graph(A)
but I get error:
ERROR: ArgumentError: Adjacency /…

RM-
- 986
- 1
- 13
- 30
3
votes
2 answers
Adding custom names for vertices
I want to create a graph with custom vertex names. Is this possible with MetaGraphs.jl ?
using MetaGraphs
using LightGraphs
using GraphPlot
# Create empty graph
gm = MetaGraph()
# Add vertices with properties
add_vertex!(gm, :A,…

imantha
- 2,676
- 4
- 23
- 46
3
votes
3 answers
How to remove self-loops in Lightgraphs
I am new to Julia and LightGraphs and I have been trying to find the most efficient way of detecting and removing self-loops. So far, the only way I have found is to iterate over all nodes in the Simplegraph, check whether it has a self-loop, and…

pegah
- 791
- 8
- 15
3
votes
1 answer
Getting the Vertices numbers from an Edge
I am using the shortest path algorithm from LightGraphs.jl. In the end I want to collect some information about the nodes along the path. In order to do that I need to be able to extract the vertices from the edges that the function gives…

fermion4
- 65
- 3
3
votes
2 answers
Import a graph (network) in Julia
Does anybody now if there is any module that could let me import a graph (network) in Julia?
Working with Python, I used the graph-tool package, which served me very well! I have my graphs in .gt file format. Can I use any module in Julia, so that I…

Leonidas Souliotis
- 105
- 1
- 9
2
votes
1 answer
random_configuration_model(N,E) takes to long on LightGraphs.jl
I'm facing problems with the generation of configurational graphs on LightGraphs. Hereafter, the vector E contains the sequence of edges. I have to generate this kind of graph iteratively inside a loop and the example below reproduces the…

Leonardo Ferreira
- 45
- 4
2
votes
2 answers
Is there any faster method to solve differential equations with multidimensional array
I want a solve a complex network system involving higher-order interaction terms acting through a multidimensional array. I have written the corresponding code but it takes too much time to get my results. Is there any possible way to solve the…

MSA
- 55
- 3
2
votes
2 answers
How to add free edge to graph in LightGraphs (Julia)?
I am adding edges to a simple weighted directed graph (from SimpleWeightedDiGraph() that is part of LightGraphs package) in Julia. Some of the arcs are "free" (null weight). However, when specifying the weight of 0 it is not added as a new edge and…

Berni
- 93
- 10
1
vote
1 answer
Exclude unconnected nodes in LightGraphs
I have generated a network via random draws. Now when I plot the network via LightGraphs.jl I also get the unconnected nodes:
However, I wish to exclude those nodes from the graph. Is this possible?

Daniël
- 111
- 3
1
vote
0 answers
Using OpenStreetMapX to create a powergrid graph network
I want to find out a few things about OpenStreetMapX which from what I understand works well with transportation-based networks. I am wondering if it's also possible to use this package along with lightgraphs.jl to create a power grid network. In my…

imantha
- 2,676
- 4
- 23
- 46
1
vote
1 answer
Subgraph in LightGraphs - Julia
Say that I have a big network with 10^4 nodes. And then I want to analyse the neighbourhood associated with a random node, say node 10. I can see which are the nodes connected to that node by looking at the 10th row entries of the adjacency matrix,…

dapias
- 2,512
- 3
- 15
- 23
1
vote
1 answer
Error while using LightGraphs to load a graph (xml.gz) in Julia
I am trying to load a network in the format xml.gz in Julia by using GraphIO.
The code is the following:
using LightGraphs
using GraphIO
D = loadgraphs("test.xml.gz", GraphMLFormat())
and I get the following error:
┌ Warning:…

RiegelGestr
- 23
- 3
1
vote
1 answer
Create Static Directed Graph in Julia
How can I create a Static Directed Graph from an array of tuples in Julia without having to create a Simple Directed Graph first. An example edge list I have is [(1,2),(2,3),(3,4)]. The documentation of StaticGraphs.jl is limited.

decardinb
- 160
- 9
1
vote
1 answer
Julia module for subgraphing a graph (nodes / vertices and edges) without changing or relabeling node indices?
Terminology note: "vertices"="nodes", "vertex/node labels" = "indices"
LightGraphs in Julia changes node indices when producing induced subgraphs.
For instance, if a graph has nodes [1, 2, 3, 4], its LightGraphs.induced_subgraph induced by nodes…

JoseOrtiz3
- 1,785
- 17
- 28