Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R: return vertex names instead of vertex ids #2

Closed
gaborcsardi opened this issue Jan 14, 2015 · 7 comments
Closed

R: return vertex names instead of vertex ids #2

gaborcsardi opened this issue Jan 14, 2015 · 7 comments
Assignees

Comments

@gaborcsardi
Copy link
Contributor

From @gaborcsardi on May 4, 2013 18:54

Or, instead of returning a character vector, we could return an igraph.vs. The same for edges.

igraph.vs is a bit tricky, because we don't necessarily want the (potentially big) graph hanging around just because there is an igraph.vs object hanging around somewhere.

An alternative would be to return character vectors with symbolic vertex ids.


Imported from Launchpad using lp2gh.

Copied from original issue: igraph/igraph#113

@gaborcsardi
Copy link
Contributor Author

(by gabor.csardi)
This change is probably too big for version 0.6, let's postpone it to 0.7.

@gaborcsardi
Copy link
Contributor Author

With the repaired vs and es indexing returning vs and es seems to be possible. The problem is that these return values cannot be used with modified graph objects. (But they should not be used, anyway.)

But a lot of functions return vertex/edge ids, do we want to change all of them? Here are all of them, unless I forgot some:

  • all_shortest_paths
  • articulation_points
  • bfs
  • biconnected_components
  • blocks
  • canonical_permutation
  • cliques
  • dfs
  • dominator_tree
  • ego
  • ends
  • farthest_vertices
  • fit_hrg
  • get_diameter
  • girth
  • graphlet_basis
  • graphlets
  • groups
  • head_of
  • incident
  • ivs
  • largest_cliques
  • largest_ivs
  • max_cardinality
  • max_cliques
  • max_flow
  • maximal_ivs
  • min_cut
  • min_separators
  • min_st_separators
  • neighbors
  • predict_edges
  • shortest_paths
  • st_cuts
  • st_min_cuts
  • subcomponent
  • tail_of
  • topo_sort
  • triangles
  • unfold_tree

@gaborcsardi
Copy link
Contributor Author

@gaborcsardi
Copy link
Contributor Author

groups is tricky, because it is not called on the graph. If we want a vs there, then we need to call groups on the graph (as well):

clu <- components(g)
groups(g, clu)

@gaborcsardi
Copy link
Contributor Author

One big problem is that when one saves an object to a file, the whole graph is saved, too. So returning vs/es is a bad idea..... :( We should return vertex names instead.

@gaborcsardi
Copy link
Contributor Author

This is mostly sorted out by now, with weak references.

Copy link
Contributor

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant