easygraph.datasets.roadnet module#

RoadNet-CA Dataset

This dataset represents the road network of California. Nodes correspond to intersections, and edges represent roads connecting them.

The data is undirected and unweighted. No features or labels are provided.

Statistics: - Nodes: 1,965,206 - Edges: 2,766,607 - Features: None - Labels: None

Reference: J. Leskovec and A. Krevl, “SNAP Datasets: Stanford Large Network Dataset Collection,” https://snap.stanford.edu/data/roadNet-CA.html

class easygraph.datasets.roadnet.RoadNetCADataset(raw_dir=None, force_reload=False, verbose=True, transform=None)[source]#

Bases: EasyGraphBuiltinDataset

Road network of California (RoadNet-CA)

Nodes are road intersections and edges are roads connecting them.

Parameters:
  • raw_dir (str, optional) – Directory to store the raw downloaded files. Default: None

  • force_reload (bool, optional) – Whether to re-download and process the dataset. Default: False

  • verbose (bool, optional) – Whether to print detailed processing logs. Default: True

  • transform (callable, optional) – Optional transform to apply on the graph.

Examples

>>> from easygraph.datasets import RoadNetCADataset
>>> dataset = RoadNetCADataset()
>>> g = dataset[0]
>>> print("Nodes:", g.number_of_nodes())
>>> print("Edges:", g.number_of_edges())
download()[source]#

Download and decompress the .txt.gz file.

process()[source]#

Overwrite to realize your own logic of processing the input data.