vstenby commited on
Commit
f492f85
·
verified ·
1 Parent(s): 4837b17

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +78 -58
README.md CHANGED
@@ -1,58 +1,78 @@
1
- ---
2
- dataset_info:
3
- features:
4
- - name: algorithm
5
- dtype: string
6
- - name: edge_list
7
- dtype: string
8
- - name: node_count
9
- dtype: int64
10
- - name: edge_count
11
- dtype: int64
12
- - name: cycle_check
13
- dtype: bool
14
- - name: triangle_count
15
- dtype: int64
16
- - name: node_degree_node
17
- dtype: int64
18
- - name: node_degree
19
- dtype: int64
20
- - name: connected_nodes_node
21
- dtype: int64
22
- - name: connected_nodes
23
- dtype: string
24
- - name: edge_existence_src
25
- dtype: int64
26
- - name: edge_existence_dst
27
- dtype: int64
28
- - name: edge_existence
29
- dtype: bool
30
- - name: reachability_src
31
- dtype: int64
32
- - name: reachability_dst
33
- dtype: int64
34
- - name: reachability
35
- dtype: bool
36
- - name: shortest_path_src
37
- dtype: int64
38
- - name: shortest_path_dst
39
- dtype: int64
40
- - name: shortest_path
41
- dtype: int64
42
- splits:
43
- - name: train
44
- num_bytes: 38654302
45
- num_examples: 81841
46
- - name: test
47
- num_bytes: 1891565
48
- num_examples: 4099
49
- download_size: 11899101
50
- dataset_size: 40545867
51
- configs:
52
- - config_name: default
53
- data_files:
54
- - split: train
55
- path: data/train-*
56
- - split: test
57
- path: data/test-*
58
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Erdős Graph Dataset with Task Labels
2
+
3
+ A graph dataset derived from [PKU-ML/Erdos](https://huggingface.co/datasets/PKU-ML/Erdos),
4
+ containing undirected graphs with pre-computed answers for 9 graph reasoning tasks.
5
+ This dataset follows the same format as [vstenby/random-graphs](https://huggingface.co/datasets/vstenby/random-graphs).
6
+
7
+ ## Dataset Description
8
+
9
+ This dataset contains graphs from the PKU-ML/Erdos benchmark, filtered to include only
10
+ undirected graphs. Each graph has been processed to:
11
+ - Convert edges to 0-indexed (for PyTorch Geometric compatibility)
12
+ - Add pre-computed task columns matching the random-graphs format
13
+
14
+ ## Dataset Structure
15
+
16
+ ### Data Fields
17
+
18
+ | Field | Type | Description |
19
+ |-------|------|-------------|
20
+ | algorithm | string | Always "erdos" |
21
+ | edge_list | string | Edge list in format [(u, v), (x, y), ...] |
22
+
23
+ #### Task Columns
24
+
25
+ | Task | Columns | Description |
26
+ |------|---------|-------------|
27
+ | node_count | node_count (int) | Number of nodes in the graph |
28
+ | edge_count | edge_count (int) | Number of edges in the graph |
29
+ | node_degree | node_degree_node (int), node_degree (int) | Sampled node and its degree |
30
+ | edge_existence | edge_existence_src (int), edge_existence_dst (int), edge_existence (bool) | Two sampled nodes and whether an edge exists between them |
31
+ | cycle_check | cycle_check (bool) | Whether the graph contains a cycle |
32
+ | triangle_counting | triangle_count (int) | Number of triangles in the graph |
33
+ | connected_nodes | connected_nodes_node (int), connected_nodes (string) | Sampled node and comma-separated list of its neighbors |
34
+ | reachability | reachability_src (int), reachability_dst (int), reachability (bool) | Two sampled nodes and whether a path exists between them |
35
+ | shortest_path | shortest_path_src (int), shortest_path_dst (int), shortest_path (int) | Two sampled nodes and shortest path length (-1 if no path exists) |
36
+
37
+ ### Data Splits
38
+
39
+ | Split | Examples |
40
+ |-------|----------|
41
+ | train | ~82,000 |
42
+ | test | ~4,000 |
43
+
44
+ ## Usage
45
+
46
+ ```python
47
+ from datasets import load_dataset
48
+
49
+ dataset = load_dataset("vstenby/erdos")
50
+
51
+ # Access a sample
52
+ sample = dataset["train"][0]
53
+ print(f"Algorithm: {sample['algorithm']}")
54
+ print(f"Node count: {sample['node_count']}")
55
+ print(f"Edge count: {sample['edge_count']}")
56
+ print(f"Has cycle: {sample['cycle_check']}")
57
+ print(f"Triangle count: {sample['triangle_count']}")
58
+
59
+ # Node-specific tasks
60
+ print(f"Node {sample['node_degree_node']} has degree {sample['node_degree']}")
61
+ print(f"Node {sample['connected_nodes_node']} is connected to: {sample['connected_nodes']}")
62
+
63
+ # Edge/path tasks
64
+ print(f"Edge between {sample['edge_existence_src']} and {sample['edge_existence_dst']}: {sample['edge_existence']}")
65
+ print(f"Path from {sample['reachability_src']} to {sample['reachability_dst']}: {sample['reachability']}")
66
+ print(f"Shortest path from {sample['shortest_path_src']} to {sample['shortest_path_dst']}: {sample['shortest_path']}")
67
+ ```
68
+
69
+ ## Generation Details
70
+
71
+ - **Source**: [PKU-ML/Erdos](https://huggingface.co/datasets/PKU-ML/Erdos)
72
+ - **Filtering**: Only undirected graphs included; isomorphic_mapping task excluded
73
+ - **Random seed**: 42 (train), 44 (test) for reproducible node/edge sampling
74
+ - **Edge indexing**: Converted from 1-indexed to 0-indexed
75
+
76
+ ## License
77
+
78
+ MIT License