Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Fallback for all edge operations #1287

Open
matbesancon opened this issue Feb 19, 2020 · 15 comments
Open

Fallback for all edge operations #1287

matbesancon opened this issue Feb 19, 2020 · 15 comments
Labels
enhancement new or improved functionality good first issue ideal for new users/contributors - easy but important

Comments

@matbesancon
Copy link
Contributor

It would be handy for all edge operations to have both f(g, e) and f(g, src(e), dst(e)) defined by default on abstract graphs

@matbesancon matbesancon added the bug confirmed bug producing incorrect results label Feb 19, 2020
@sbromberger sbromberger added enhancement new or improved functionality good first issue ideal for new users/contributors - easy but important HackIllinois and removed bug confirmed bug producing incorrect results labels Feb 19, 2020
@sbromberger
Copy link
Owner

(Agreed, but since this currently isn't manifesting as incorrect / unintended behavior, I've removed the "bug" tag.)

@sbromberger
Copy link
Owner

@matbesancon could you start compiling a list of functions that will require new methods?

@matbesancon
Copy link
Contributor Author

Indeed the bug tag was my mistake, the github mobile interface is a bit of a pain

@matbesancon
Copy link
Contributor Author

I've mostly noticed it for add_edge! rem_edge! has_edge

@birm
Copy link
Contributor

birm commented Mar 8, 2020

Do you have an example of code that demonstrates a case where one of those definitions doesn't work?

@stale
Copy link

stale bot commented May 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix known (and usually documented) limitation; no remediation necessary label May 9, 2020
@matbesancon
Copy link
Contributor Author

bump

@stale stale bot removed the wontfix known (and usually documented) limitation; no remediation necessary label May 9, 2020
@matbesancon
Copy link
Contributor Author

(just for stalebot)

@stale
Copy link

stale bot commented Jul 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix known (and usually documented) limitation; no remediation necessary label Jul 11, 2020
@matbesancon
Copy link
Contributor Author

go away bot

@stale stale bot removed the wontfix known (and usually documented) limitation; no remediation necessary label Jul 13, 2020
@stale
Copy link

stale bot commented Sep 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix known (and usually documented) limitation; no remediation necessary label Sep 11, 2020
@sbromberger
Copy link
Owner

@matbesancon did we ever fix this?

@stale stale bot removed the wontfix known (and usually documented) limitation; no remediation necessary label Dec 24, 2020
@matbesancon
Copy link
Contributor Author

No I don't think we did. It is done for has_edge:
https://github.com/JuliaGraphs/LightGraphs.jl/blob/stable/src/interface.jl#L277

But it is the only function using edges in the interface. So not for all mutation functions adding and removing edges

@gdalle
Copy link
Contributor

gdalle commented Dec 29, 2020

Since the discussion is not closed about this, I have a related issue. Would it be possible to access edges based on src and dst, mainly to get their index in the list of all edges? Does it fit in the same batch of potential changes?
Just a newbie speaking, so don't mind me too much

@sbromberger
Copy link
Owner

sbromberger commented Dec 29, 2020

There is no Lightgraphs-based graph type that I know of that allows global edge indexing (e.g., get_edge(g, 15) returns whatever you determine to be the "15th" edge in the graph).

You could always make a graph type that does this (just define your data type with methods that allow indexing of the edges, and implement the 10 or so API functions that LightGraphs needs, and everything else should just work).

If you don't care about memory usage and you don't make changes to the graph, a collect(edges(g)) might suffice. But you're storing |2E| memory to do that (but with O(1) lookup, so that might be more important).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement new or improved functionality good first issue ideal for new users/contributors - easy but important
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants