# Graphs

**URL:** https://discourse.julialang.org/c/domain/graphs/73.md?page=3

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 4

---

## [Interactive network visualization](https://discourse.julialang.org/t/interactive-network-visualization/49054)

<div class="topic-metadata">

**Author:** [@elkaps](https://discourse.julialang.org/u/elkaps)\
**Replies:** 22\
**Last updated:** [October 4, 2021, 11:56am UTC](https://discourse.julialang.org/t/interactive-network-visualization/49054 "2021-10-04T11:56:57Z")

</div>

I’m looking for a way to visualize networks while being able to add/remove/move vertices interactively. I’ve seen NetworkViz but it doesn’t look maintained anymore. Would it be possible to use GraphRecipes by getting t…

---

## [How to read a graph from a GML file](https://discourse.julialang.org/t/how-to-read-a-graph-from-a-gml-file/68539)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 1\
**Last updated:** [September 22, 2021, 6:03am UTC](https://discourse.julialang.org/t/how-to-read-a-graph-from-a-gml-file/68539 "2021-09-22T06:03:38Z")

</div>

I cannot figure out how to get a graph definition from a GML file. I downloaded the following file https://github.com/empet/Datasets/blob/master/gstrang\_descendants.gml and tried with the following code: using Ligh…

---

## [Converting a directed graph to undirected](https://discourse.julialang.org/t/converting-a-directed-graph-to-undirected/66932)

<div class="topic-metadata">

**Author:** [@rachithaiyappa](https://discourse.julialang.org/u/rachithaiyappa)\
**Replies:** 4\
**Last updated:** [August 31, 2021, 2:16pm UTC](https://discourse.julialang.org/t/converting-a-directed-graph-to-undirected/66932 "2021-08-31T14:16:16Z")

</div>

I am reading a graph from an edge list and then trying to convert the directed graph into undirected as follows. using GraphIO using SimpleGraphs data = "network.txt" #edge list of the network g = loadgraph(data,GraphI…

---

## [Plotting weighted graphs?](https://discourse.julialang.org/t/plotting-weighted-graphs/67277)

<div class="topic-metadata">

**Author:** [@Tqft](https://discourse.julialang.org/u/Tqft)\
**Replies:** 1\
**Last updated:** [August 29, 2021, 10:52am UTC](https://discourse.julialang.org/t/plotting-weighted-graphs/67277 "2021-08-29T10:52:45Z")

</div>

I’m dealing with weighted graphs (Dynkin diagrams for example) and need a simple way to plot them, preferably even on the terminal (in most examples the user would like to look at there are only a few vertices). Is there…

---

## [Metagraphs/GraphIO: How to save graph properties to file?](https://discourse.julialang.org/t/metagraphs-graphio-how-to-save-graph-properties-to-file/23553)

<div class="topic-metadata">

**Author:** [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Replies:** 0\
**Last updated:** [April 26, 2019, 12:30pm UTC](https://discourse.julialang.org/t/metagraphs-graphio-how-to-save-graph-properties-to-file/23553 "2019-04-26T12:30:34Z")

</div>

Dear Community, I have a graph with several properties on nodes and edges but fail to save them to a standard format, for instance, GML. Here is minimal example: #packages using LightGraphs, MetaGraphs, GraphIO, Parser…

---

## [Differences in methods of constructing graph and calculating the shortest path](https://discourse.julialang.org/t/differences-in-methods-of-constructing-graph-and-calculating-the-shortest-path/61877)

<div class="topic-metadata">

**Author:** [@trathi](https://discourse.julialang.org/u/trathi)\
**Replies:** 0\
**Last updated:** [May 26, 2021, 6:19pm UTC](https://discourse.julialang.org/t/differences-in-methods-of-constructing-graph-and-calculating-the-shortest-path/61877 "2021-05-26T18:19:55Z")

</div>

Hi. I am new to using LightGraphs and SimpleWeightedGraph and have a few questions regarding their usage: I see that edges with zero weights are ignored when using add\_edge! to define edges (also mentioned here); howev…

---

## [Help with LightGraphs.jl](https://discourse.julialang.org/t/help-with-lightgraphs-jl/66663)

<div class="topic-metadata">

**Author:** [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)\
**Replies:** 6\
**Last updated:** [August 20, 2021, 10:13am UTC](https://discourse.julialang.org/t/help-with-lightgraphs-jl/66663 "2021-08-20T10:13:24Z")

</div>

Hello, I am trying to move away from the R package iGraph to LightGraphs.jl but am having difficulty. I have a food web where each species is a node and a link connects it to another species (node) - this is translated…

---

## [LightGraphs benchmark study, take 2](https://discourse.julialang.org/t/lightgraphs-benchmark-study-take-2/39297)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 6\
**Last updated:** [August 18, 2021, 10:07pm UTC](https://discourse.julialang.org/t/lightgraphs-benchmark-study-take-2/39297 "2021-08-18T22:07:46Z")

</div>

Hi all, You might recall that back in February Tim Lin posted some graph benchmarks, and LightGraphs did reasonably well. In my post at the time, I mentioned that Tim was going to re-run the benchmarks in a few months. …

---

## [How to use \`bfs\_tree\` and \`dfs\_tree\` from \`LightGraphs.jl\`](https://discourse.julialang.org/t/how-to-use-bfs-tree-and-dfs-tree-from-lightgraphs-jl/66331)

<div class="topic-metadata">

**Author:** [@mroavi](https://discourse.julialang.org/u/mroavi)\
**Replies:** 8\
**Last updated:** [August 16, 2021, 8:55am UTC](https://discourse.julialang.org/t/how-to-use-bfs-tree-and-dfs-tree-from-lightgraphs-jl/66331 "2021-08-16T08:55:19Z")

</div>

I’m trying to understand how to use bfs\_tree and dfs\_tree from LightGraphs.jl . They both return the same graph so I don’t know how to extract the actual order in which the nodes were visited. using LightGraphs g = dou…

---

## [Selecting best DAG from the family of DAGs based on AIC score](https://discourse.julialang.org/t/selecting-best-dag-from-the-family-of-dags-based-on-aic-score/62611)

<div class="topic-metadata">

**Author:** [@ashwanimalviya](https://discourse.julialang.org/u/ashwanimalviya)\
**Replies:** 6\
**Last updated:** [June 10, 2021, 6:11am UTC](https://discourse.julialang.org/t/selecting-best-dag-from-the-family-of-dags-based-on-aic-score/62611 "2021-06-10T06:11:46Z")

</div>

Thank you @Jeff Erlich for your suggestion to post my question on discourse. I would like to say to the Julia community here, I have posted a question(In the link) and have one more block regarding this Slack issue. I h…

---

## [How to plot a graph with labels for vertices?](https://discourse.julialang.org/t/how-to-plot-a-graph-with-labels-for-vertices/62106)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 2\
**Last updated:** [May 31, 2021, 4:33am UTC](https://discourse.julialang.org/t/how-to-plot-a-graph-with-labels-for-vertices/62106 "2021-05-31T04:33:00Z")

</div>

I am trying to do use LightGraphs.jl to plot some graphs which is ok but I want t label the vertices and edges too. I have used MetaGraphs to add metadata to each edge but I can’t seem to find a way to plot the graph wi…

---

## [Issue saving graphs using LightGraph](https://discourse.julialang.org/t/issue-saving-graphs-using-lightgraph/60826)

<div class="topic-metadata">

**Author:** [@bfried1](https://discourse.julialang.org/u/bfried1)\
**Replies:** 1\
**Last updated:** [May 10, 2021, 2:28am UTC](https://discourse.julialang.org/t/issue-saving-graphs-using-lightgraph/60826 "2021-05-10T02:28:36Z")

</div>

I am having trouble simply saving a graph in one of the formats offered by GraphIO

---

## [Periodic lattices with LightGraph](https://discourse.julialang.org/t/periodic-lattices-with-lightgraph/60454)

<div class="topic-metadata">

**Author:** [@Marco\_Antoniotti](https://discourse.julialang.org/u/Marco_Antoniotti)\
**Replies:** 2\
**Last updated:** [May 3, 2021, 1:09pm UTC](https://discourse.julialang.org/t/periodic-lattices-with-lightgraph/60454 "2021-05-03T13:09:20Z")

</div>

Hi just being lazy here… What would be the simplest way to produce a periodic lattice with LightGraphs? I.e. a “cylinder”. Thanks Marco

---

## [Matrix of downstream nodes using LightGraphs](https://discourse.julialang.org/t/matrix-of-downstream-nodes-using-lightgraphs/60314)

<div class="topic-metadata">

**Author:** [@Cappuccio](https://discourse.julialang.org/u/Cappuccio)\
**Replies:** 0\
**Last updated:** [April 30, 2021, 1:55pm UTC](https://discourse.julialang.org/t/matrix-of-downstream-nodes-using-lightgraphs/60314 "2021-04-30T13:55:14Z")

</div>

Does anyone have an idea as to how you would create a vector of ‘downstream nodes’ for a given node in a network, using LightGraphs? For example, see the network attached, all downstream nodes of 17 would be \[19, 20, …

---

## [Complexity function center LightGraphs](https://discourse.julialang.org/t/complexity-function-center-lightgraphs/59592)

<div class="topic-metadata">

**Author:** [@afazevedo](https://discourse.julialang.org/u/afazevedo)\
**Replies:** 0\
**Last updated:** [April 19, 2021, 1:29pm UTC](https://discourse.julialang.org/t/complexity-function-center-lightgraphs/59592 "2021-04-19T13:29:34Z")

</div>

Hey guys, Someone know the complexity of the “center” function in the LightGraphs package? Futhermore, I take the opportunity to ask if there is any package that calculates complexity of functions in Julia. Thank you …

---

## [Generic edgeMap function for graph algorithms like Bellman-Ford](https://discourse.julialang.org/t/generic-edgemap-function-for-graph-algorithms-like-bellman-ford/57416)

<div class="topic-metadata">

**Author:** [@Aje12](https://discourse.julialang.org/u/Aje12)\
**Replies:** 0\
**Last updated:** [March 17, 2021, 9:17pm UTC](https://discourse.julialang.org/t/generic-edgemap-function-for-graph-algorithms-like-bellman-ford/57416 "2021-03-17T21:17:49Z")

</div>

Hi everyone, Apologies for this being a long one. I am working with the bellman ford algorithm from lightgraphs.jl but having an issue with some of my functions. My intension behind this is to have a general mapping fun…

---

## [For a tree, how to obtain two induced subgraph by breaking an edge in LightGraphs?](https://discourse.julialang.org/t/for-a-tree-how-to-obtain-two-induced-subgraph-by-breaking-an-edge-in-lightgraphs/56676)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 0\
**Last updated:** [March 7, 2021, 2:12pm UTC](https://discourse.julialang.org/t/for-a-tree-how-to-obtain-two-induced-subgraph-by-breaking-an-edge-in-lightgraphs/56676 "2021-03-07T14:12:24Z")

</div>

For example, if I have a tree 1 - 2 - 3 - 4 | | 5 6 - 7 - 8 If breaking the ege (3,6), I want to obtain two induced subgraphs 1 -…

---

## [Interactive display for graphs (graph theory)](https://discourse.julialang.org/t/interactive-display-for-graphs-graph-theory/55710)

<div class="topic-metadata">

**Author:** [@AlexanderChen](https://discourse.julialang.org/u/AlexanderChen)\
**Replies:** 7\
**Last updated:** [February 23, 2021, 8:38am UTC](https://discourse.julialang.org/t/interactive-display-for-graphs-graph-theory/55710 "2021-02-23T08:38:00Z")

</div>

The project I am working on has 3 parts. develop a workflow in which SQL tables can be represented in graph form with the relevant meta information and the ability to develop a workflow to connect columns of different…

---

## [Format LightGraph / GraphPlot](https://discourse.julialang.org/t/format-lightgraph-graphplot/54373)

<div class="topic-metadata">

**Author:** [@ZettEff](https://discourse.julialang.org/u/ZettEff)\
**Replies:** 0\
**Last updated:** [February 1, 2021, 1:35pm UTC](https://discourse.julialang.org/t/format-lightgraph-graphplot/54373 "2021-02-01T13:35:45Z")

</div>

Hi! I am experimenting with LightGraph and GraphPlot packages. Below code is a MWE which is working. So my issue is not that my below code has a bug. However, two things I cannot manage: How can I ensure that the n…

---

## [Unioning MetaGraphs](https://discourse.julialang.org/t/unioning-metagraphs/49204)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 0\
**Last updated:** [October 28, 2020, 8:33pm UTC](https://discourse.julialang.org/t/unioning-metagraphs/49204 "2020-10-28T20:33:40Z")

</div>

I don’t completely understand the error, but looks like some methods from Base might need to be exended. What is the minimum I would need to implement to make this work?: g1 = MetaDiGraph(4) add\_edge!(g1, 1, 2) add\_edg…

---

## [Help speed up SimpleGraph creation](https://discourse.julialang.org/t/help-speed-up-simplegraph-creation/48754)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 4\
**Last updated:** [October 21, 2020, 5:58pm UTC](https://discourse.julialang.org/t/help-speed-up-simplegraph-creation/48754 "2020-10-21T17:58:56Z")

</div>

Here’s a MWE of what I’m attempting to do: using DataFrames using LightGraphs using ProgressMeter df = DataFrame(a = rand(1:50\_000, 150\_000), b = rand(1:25\_000, 150\_000)) |\> unique! vs = unique(vcat(df.a, df.b)) n = le…

---

## [Pair of non-intersecting shortest paths on undirected graph](https://discourse.julialang.org/t/pair-of-non-intersecting-shortest-paths-on-undirected-graph/47988)

<div class="topic-metadata">

**Author:** [@mastrof](https://discourse.julialang.org/u/mastrof)\
**Replies:** 6\
**Last updated:** [October 9, 2020, 5:30pm UTC](https://discourse.julialang.org/t/pair-of-non-intersecting-shortest-paths-on-undirected-graph/47988 "2020-10-09T17:30:24Z")

</div>

Hello, I only have a very basic background in graph theory and don’t really know the ideas behind most of the algorithms that are used for path/cycle detection, yet I have somehow found myself in a position where I’m wo…

---

## [GraphRecipes (or equivalent) for this series of plots](https://discourse.julialang.org/t/graphrecipes-or-equivalent-for-this-series-of-plots/47544)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 0\
**Last updated:** [September 30, 2020, 4:09pm UTC](https://discourse.julialang.org/t/graphrecipes-or-equivalent-for-this-series-of-plots/47544 "2020-09-30T16:09:44Z")

</div>

I have a directed graph in LightGraphs and I want to produce a series of plots each with the same circular layout but highlighting different subsets of edges, with highlighting on the nodes:

---

## [Making gif out of graphs](https://discourse.julialang.org/t/making-gif-out-of-graphs/47143)

<div class="topic-metadata">

**Author:** [@Codzilla](https://discourse.julialang.org/u/Codzilla)\
**Replies:** 2\
**Last updated:** [September 24, 2020, 5:47pm UTC](https://discourse.julialang.org/t/making-gif-out-of-graphs/47143 "2020-09-24T17:47:43Z")

</div>

Hi, I’m teaching an undergraduate class in algorithmics and I would like to make some nice visualization of algorithms on graphs. To do so I would like to make gifs out of plots of graphs. I would very much like to use…

---

## [Reading DOT graph](https://discourse.julialang.org/t/reading-dot-graph/46683)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 1\
**Last updated:** [September 18, 2020, 1:19am UTC](https://discourse.julialang.org/t/reading-dot-graph/46683 "2020-09-18T01:19:41Z")

</div>

I have: julia\> using LightGraphs, GraphIO julia\> graph = loadgraph("gr.dot", "gr", DOTFormat()) ERROR: UndefVarError: DOT not defined Stacktrace: \[1\] DOTFormat() at /home/paul/.julia/packages/GraphIO/IgxnP/src/depreca…

---

## [Is there any graph / graph plotting package that allow edges having different color and length based on its identity and weight?](https://discourse.julialang.org/t/is-there-any-graph-graph-plotting-package-that-allow-edges-having-different-color-and-length-based-on-its-identity-and-weight/45982)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 2\
**Last updated:** [September 6, 2020, 8:55am UTC](https://discourse.julialang.org/t/is-there-any-graph-graph-plotting-package-that-allow-edges-having-different-color-and-length-based-on-its-identity-and-weight/45982 "2020-09-06T08:55:23Z")

</div>

Usecase: Displaying the architecture of block copolymers. Block copolymers consist of many blocks each of which contains identical monomers and are connected by covalent bond at their joints. I think the natural way to d…

---

## [Understanding LightGraph's depth-first search](https://discourse.julialang.org/t/understanding-lightgraphs-depth-first-search/45785)

<div class="topic-metadata">

**Author:** [@mroavi](https://discourse.julialang.org/u/mroavi)\
**Replies:** 2\
**Last updated:** [September 2, 2020, 11:39am UTC](https://discourse.julialang.org/t/understanding-lightgraphs-depth-first-search/45785 "2020-09-02T11:39:33Z")

</div>

Hello everyone, I want to use the depth-first search functionality offered by LightGraphs.jl. However, I don’t seem to understand the results given by the dfs\_parents function. I wrote a simple example using LightGrap…

---

## [LightGraphs: get all of the the shortest paths between 2 points?](https://discourse.julialang.org/t/lightgraphs-get-all-of-the-the-shortest-paths-between-2-points/28775)

<div class="topic-metadata">

**Author:** [@wherrera](https://discourse.julialang.org/u/wherrera)\
**Replies:** 1\
**Last updated:** [August 30, 2020, 8:46pm UTC](https://discourse.julialang.org/t/lightgraphs-get-all-of-the-the-shortest-paths-between-2-points/28775 "2020-08-30T20:46:33Z")

</div>

Consider using LightGraphs g = SimpleDiGraph(7) add\_edge!(g, 1, 2) add\_edge!(g, 2, 3) add\_edge!(g, 4, 5) add\_edge!(g, 5, 3) add\_edge!(g, 1, 5) add\_edge!(g, 6, 7) add\_edge!(g, 7, 3) add\_edge!(g, 1, 7) p = dijkstra\_shor…

---

## [GraphRecipes versus GraphPlot: why such a big performance disparity?](https://discourse.julialang.org/t/graphrecipes-versus-graphplot-why-such-a-big-performance-disparity/43474)

<div class="topic-metadata">

**Author:** [@izzorts](https://discourse.julialang.org/u/izzorts)\
**Replies:** 0\
**Last updated:** [July 22, 2020, 5:38am UTC](https://discourse.julialang.org/t/graphrecipes-versus-graphplot-why-such-a-big-performance-disparity/43474 "2020-07-22T05:38:52Z")

</div>

So, I was trying to plot some graphs and GraphPlot happened to be insufficient (I needed smaller labels than what seems to be the inferior size limit). Then I went trying to use GraphRecipes, because it seemed to have bo…

---

## [Allocations when creating graphs, inefficiencies](https://discourse.julialang.org/t/allocations-when-creating-graphs-inefficiencies/42394)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 12\
**Last updated:** [July 2, 2020, 9:57am UTC](https://discourse.julialang.org/t/allocations-when-creating-graphs-inefficiencies/42394 "2020-07-02T09:57:55Z")

</div>

I am creating my own method to create a graph in 3D because graphplot has a bug, which I reported here and on Github, and I got no reply, and yet I still need the plot. Here is some MWE, which I run 2-3 times to make sur…

[Previous page](https://discourse.julialang.org/c/domain/graphs/73.md?page=2)

[Next page](https://discourse.julialang.org/c/domain/graphs/73.md?page=4)
