Repository navigation
Description
This issue unifies three related threads:
- Remove
return.vs.esoption #1652 — remove thereturn.vs.esoption. - Some functions that return vertex or edge sequences ignore the value of the option
return.vs.es#1614 — some functions ignorereturn.vs.es(consistency); partially
addressed by PR [WIP] Fix functions ignoring return.vs.es option #2439. - Slower speed vs basic edgelist in some tasks #557 —
igraph.vs/igraph.esare much slower than plain edge lists/indices.
They are the same problem from three angles: the option exists mainly for
performance (#557), it is applied inconsistently (#1614), and the
long-term goal is to remove it (#1652) with as.integer() as the
replacement. Removal is blocked until the performance gap is closed — e.g.
max_cliques(sample_gnp(500, 0.15)) is ~8× slower with return.vs.es = TRUE
(268 ms vs 33 ms) because create_vs() builds names eagerly. The endorsed
direction is lazy (ALTREP) naming so igraph.vs/igraph.es is as cheap as a
numeric vector and names are materialized only on print/use.
Steps to close
Phase 0 — Close the performance gap (prerequisite)
- Make vertex/edge sequence construction lazy (ALTREP-backed names), so
create_vs()/create_es()andE()defer thenames/vnameswork
until printed or accessed. - Benchmark gate:
max_cliques(sample_gnp(500, 0.15))with the default
approaches the oldreturn.vs.es = FALSEtiming. If the gap isn't
closed, stop here — do not proceed to removal.
Phase 1 — Decouple internal usage from the public option
- Give the
_impllayer a private numeric-output path that does not read
return.vs.es. - Replace the
with_igraph_opt(list(return.vs.es = FALSE), ...)wrappers in
all_simple_paths()andget_edge_ids()with that mechanism (no
user-visible change).
Phase 2 — Soft-deprecate the option
- Emit
lifecycle::deprecate_warn()when a user setsreturn.vs.es,
pointing toas.integer()/as_ids(). - Update the option's roxygen doc entry with a deprecation badge + recipe.
- Add a NEWS entry. Keep the option functional for at least one release.
Phase 3 — Remove
- Drop the
if (igraph_opt("return.vs.es"))guard from theOUTCONV
templates intools/stimulus/types-RR.yaml(keep thecreate_vs/
create_esbody; keep thevcount() != 0guard forVERTEX_ROOT). - Regenerate the
R/aaa-*.Rfiles (103 sites) via codegen — do not hand-edit. - Remove the 24 hand-written guards (keep their wrapping bodies).
- Remove
return.vs.esfrom.igraph.parsand its doc entry inR/par.R;
make the deprecated setter hard-error or no-op. - Update roxygen prose referencing the option (regenerate
.Rdin CI). - Update/trim tests; full
R CMD check; runtools/revdep.Rbefore release.
Activity