Datasets:
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,58 +1,78 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 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
|