# \[ANN\] GraphsExt, features for possible inclusion in Graphs.jl

**URL:** https://discourse.julialang.org/t/ann-graphsext-features-for-possible-inclusion-in-graphs-jl/98170
**Category:** Graphs
**Tags:** announcement, graphs
**Created:** [May 1, 2023, 5:33pm UTC](https://discourse.julialang.org/t/ann-graphsext-features-for-possible-inclusion-in-graphs-jl/98170 "2023-05-01T17:33:51Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)
#### Post date: [May 1, 2023, 5:33pm UTC](https://discourse.julialang.org/t/ann-graphsext-features-for-possible-inclusion-in-graphs-jl/98170/1 "2023-05-01T17:33:51Z")

</div>

[GraphsExt.jl](https://github.com/jlapeyre/GraphsExt.jl) implements some things that may eventually be added to `Graphs.jl`. I need to use them and want to expose them before making PRs to `Graphs.jl`. This package is not registered in the general registry but is in [a “private” registry that you can use](https://github.com/jlapeyre/LapeyreRegistry).

The most important function is `remove_vertices!`. There is no efficient (better than order |V|) function in `Graphs.jl` for removing several vertices from the built-in implementations. This makes it impossible to work with large graphs that require frequently removing vertices. `remove_vertices!` is roughly independent of |V| and so solves this problem.

It returns both forward and backward vertex maps. I found both maps necessary as well as adequate for tracking vertex renumbering in external lists of vertices. See the README in the link above.

The next most interesting item is `dag_longest_path` which computes a longest path in a directed acyclic graph (DAG)

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [May 1, 2023, 5:46pm UTC](https://discourse.julialang.org/t/ann-graphsext-features-for-possible-inclusion-in-graphs-jl/98170/2 "2023-05-01T17:46:59Z")

</div>

Hey @jlapeyre, thanks for the contribution!  
Would you consider PRs to Graphs.jl soon-ish? I know we have not been very reactive on the repo, but we will do our best, and I have a little more time these days 🙂

---

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [May 1, 2023, 5:56pm UTC](https://discourse.julialang.org/t/ann-graphsext-features-for-possible-inclusion-in-graphs-jl/98170/3 "2023-05-01T17:56:49Z")

</div>

He said in the **very first line** of his post

> [GraphsExt.jl](https://github.com/jlapeyre/GraphsExt.jl) implements some things that may eventually be added to `Graphs.jl`. I need to use them and want to expose them before making PRs to `Graphs.jl`.

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [May 1, 2023, 6:01pm UTC](https://discourse.julialang.org/t/ann-graphsext-features-for-possible-inclusion-in-graphs-jl/98170/4 "2023-05-01T18:01:26Z")

</div>

My bad I missed that specific line 🙏 Edited my answer

---

<div class="post-metadata">

### Author: ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)
#### Post date: [May 1, 2023, 6:28pm UTC](https://discourse.julialang.org/t/ann-graphsext-features-for-possible-inclusion-in-graphs-jl/98170/5 "2023-05-01T18:28:49Z")

</div>

I put these in a package rather than making PRs for a few reasons.

I’m not satisfied with with the interfaces. I don’t want to spend a lot of time just now trying to get it right.

Moreover, Graphs.jl is not very active at the moment. A PR would probably be me and one other person trying to figure out the interface with no feedback from use in the wild. The most effective way to use the vertex maps is not at all obvious. I have an application that I didn’t link that works pretty well, but I imagine it’s not the end of the story.

It’s impossible to replace `rem_vertices!` in Graphs.jl with an efficient function that uses the same API because it returns a structure of size O(|V|). I don’t want to add another API that restricts improvement.

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [May 1, 2023, 6:33pm UTC](https://discourse.julialang.org/t/ann-graphsext-features-for-possible-inclusion-in-graphs-jl/98170/6 "2023-05-01T18:33:52Z")

</div>

Those are good reasons! I’m hoping to hire a student this summer to work on the ecosystem, maybe this can give it some well-needed momentum!
