Motivation
Currently, the only way to build induced subgraphs in Icebug is via NetworKit::GraphTools::subgraphFromNodes. The implementation initializes a GraphW object and adds edges incrementally.
I think it would fit with the existing Icebug framework to have a memory-efficient InducedSubgraphView that is read-only and computes neighbors on demand, similar to the CoarsenedGraphView. Ideally, it would be a subclass of Graph, so that Algorithms can run on induced subgraphs. A realize function or similar can be used to copy it into a GraphR or GraphW.
Proposed API
import networkit as nk
g = build_demo_graph()
subg_view = nk.GraphTools.subgraphViewFromNodes(g, {0, 1, 2, 3})
cores = nk.centrality.CoreDecomposition(subg_view) # can run Algorithms on subgraph views
cores.run()
subg = subg_view.realize() # same as nk.GraphTools.subgraphFromNodes(g, {0, 1, 2, 3}, compact=False)
Motivation
Currently, the only way to build induced subgraphs in Icebug is via
NetworKit::GraphTools::subgraphFromNodes. The implementation initializes a GraphW object and adds edges incrementally.I think it would fit with the existing Icebug framework to have a memory-efficient
InducedSubgraphViewthat is read-only and computes neighbors on demand, similar to theCoarsenedGraphView. Ideally, it would be a subclass ofGraph, so that Algorithms can run on induced subgraphs. Arealizefunction or similar can be used to copy it into aGraphRorGraphW.Proposed API