dabfs 0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dabfs-0.1/PKG-INFO
ADDED
dabfs-0.1/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# DABFS
|
|
2
|
+
|
|
3
|
+
**DABFS** (Dynamic Approach with BFS) is a Python package for query-preserving graph compression. It efficiently compresses directed graphs while preserving reachability queries, enabling scalable query processing on large graphs.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install dabfs
|
|
11
|
+
|
|
12
|
+
Or, install locally from the repository:
|
|
13
|
+
|
|
14
|
+
git clone https://github.com/rsltgy/DABFS.git
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
```python
|
|
19
|
+
from dabfs import DABFS
|
|
20
|
+
# Call DABFS with your edge list file
|
|
21
|
+
DABFS("data/simple_graph.txt")
|
|
22
|
+
```
|
|
23
|
+
## Input
|
|
24
|
+
A text file containing the edge list of the graph.
|
|
25
|
+
Each row represents an edge with two columns: source_node and target_node.
|
|
26
|
+
Example of simple_graph.txt:
|
|
27
|
+
```
|
|
28
|
+
1 2
|
|
29
|
+
2 3
|
|
30
|
+
3 4
|
|
31
|
+
4 1
|
|
32
|
+
5 6
|
|
33
|
+
```
|
|
34
|
+
## Output
|
|
35
|
+
```
|
|
36
|
+
After running DABFS():
|
|
37
|
+
2026-04-02 13:14:27,026 - INFO - Saved compressed data output/scc_compressed.txt
|
|
38
|
+
2026-04-02 13:14:27,028 - INFO - Total BFS time for finding all ancestors 0.00032329559326171875 sec
|
|
39
|
+
2026-04-02 13:14:27,028 - INFO - Candidate Generated 3.1948089599609375e-05 sec
|
|
40
|
+
2026-04-02 13:14:27,029 - INFO - Saved compressed data output/reachibility_query_compressed.txt
|
|
41
|
+
2026-04-02 13:14:27,030 - INFO - compression ratio is 18.181818181818183 sec
|
|
42
|
+
```
|
|
43
|
+
## Basic Example
|
|
44
|
+
```python
|
|
45
|
+
from dabfs import DABFS
|
|
46
|
+
# Compress the graph and save outputs
|
|
47
|
+
DABFS("data/simple_graph.txt")
|
|
48
|
+
```
|
|
49
|
+
Using Compressed Graphs
|
|
50
|
+
```python
|
|
51
|
+
from utils.data_reader import read_data
|
|
52
|
+
scc_graph = read_data("output/scc_compressed.txt")
|
|
53
|
+
reach_graph = read_data("output/reachability_query_compressed.txt")
|
|
54
|
+
```
|
|
55
|
+
You can now run reachability queries directly on reachability_query_compressed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
dabfs-0.1/setup.cfg
ADDED