The main data structures of this project are Data
and NAG
.
A Data
object stores a single-level graph.
It inherits from torch_geometric
's Data
and has a similar behavior (see the
official documentation
for more on this).
Important specificities of our Data
object are:
Data.super_index
stores the parent's index for each node inData
Data.sub
holds aCluster
object indicating the children of each node inData
Data.to_trimmed()
works liketorch_geometric
'sData.coalesce()
with the additional constraint that (i,j) and (j,i) edges are considered duplicatesData.save()
andData.load()
allow optimized, memory-friendly I/O operationsData.select()
indexes the nodes à la numpy
NAG
(Nested Acyclic Graph) stores the hierarchical partition in the form of a
list of Data
objects.
Important specificities of our Data
object are:
NAG[i]
returns aData
object holding the partition levelì
NAG.get_super_index()
returns the index mapping nodes from any leveli
toj
withi<j
NAG.get_sampling()
produces indices for sampling the superpoints with certain constraintsNAG.save()
andNAG.load()
allow optimized, memory-friedly I/O operationsNAG.select()
indexes the nodes of a specified partition level à la numpy and updates the rest of theNAG
structure accordingly
See the notebooks/demo_nag.ipyng
notebook to play with and visualize a
provided NAG
, without needing a whole dataset.