compress graphs with answer-set-programming
Project description
# PowerGrASP
Graph compression.
Note that this is a full reimplementation of PowerGrASP,
taking advantage of ASP and Python lifting and simplifications.
For the version published in 2017, see [this repository](https://github.com/aluriak/PowerGrASP-1).
## CLI
powergrasp mygraph.gml -o compressed.bbl
### help !
powergrasp --help
## API
```python
import powergrasp
with open('compressed.bbl', 'w') as fd:
for line in powergrasp.compress_by_cc('mygraph.gml'):
fd.write(line + '\n')
```
### help !
Sorry, no technical doc for the moment.
## Configuration
PowerGrASP have some [configuration values](powergrasp/constants.py),
that can be overwritten by a `powergrasp.cfg` file in either ini or json format,
as shown in [`test/powergrasp.oneshot.cfg`](test/powergrasp.oneshot.cfg) and [`test/powergrasp.manyoptions.cfg`](test/powergrasp.manyoptions.cfg).
Configuration allow user to define how much text will be provided by powergrasp,
or some options for core compression and output data.
## installation
pip install powergrasp
On random error, try adding `--no-cache-dir` somewhere.
## TODO
- [x] unit tests
- [x] CLI
- [x] run on big graph
- [x] search multiple motif in the same run (speed up observed on bio graph)
- [x] timers for solving, full run, output writing
- [ ] timers for extraction
- [ ] technical documentation
- [ ] search and specific compression of trees
- [ ] search and specific compression of triangle-free graphs
## Changelog
- 8.5
- config may now be given in INI format
- improve logging
- config allow optimization target between memory or CPU (currently define a constraint implementation in ASP)
- bugfix about edges yielded by ASP and multithreading parameter
- no statistics file to write by default
- timer for output writing
- config allow user to define the number of CPU for clingo to use
- simplify ASP code by removing useless arg in block/4 atoms
- 8.4
- replace ASP code constraint to achieve much more efficient grounding
- configuration allow for improved lowerbound computation of bicliques
- generated bubble allow client to give heading comments
- handle keyboard interruption during search with grace
- implement timers and statistics recording
- enable multishot motif search by default
- various bugfixes
Graph compression.
Note that this is a full reimplementation of PowerGrASP,
taking advantage of ASP and Python lifting and simplifications.
For the version published in 2017, see [this repository](https://github.com/aluriak/PowerGrASP-1).
## CLI
powergrasp mygraph.gml -o compressed.bbl
### help !
powergrasp --help
## API
```python
import powergrasp
with open('compressed.bbl', 'w') as fd:
for line in powergrasp.compress_by_cc('mygraph.gml'):
fd.write(line + '\n')
```
### help !
Sorry, no technical doc for the moment.
## Configuration
PowerGrASP have some [configuration values](powergrasp/constants.py),
that can be overwritten by a `powergrasp.cfg` file in either ini or json format,
as shown in [`test/powergrasp.oneshot.cfg`](test/powergrasp.oneshot.cfg) and [`test/powergrasp.manyoptions.cfg`](test/powergrasp.manyoptions.cfg).
Configuration allow user to define how much text will be provided by powergrasp,
or some options for core compression and output data.
## installation
pip install powergrasp
On random error, try adding `--no-cache-dir` somewhere.
## TODO
- [x] unit tests
- [x] CLI
- [x] run on big graph
- [x] search multiple motif in the same run (speed up observed on bio graph)
- [x] timers for solving, full run, output writing
- [ ] timers for extraction
- [ ] technical documentation
- [ ] search and specific compression of trees
- [ ] search and specific compression of triangle-free graphs
## Changelog
- 8.5
- config may now be given in INI format
- improve logging
- config allow optimization target between memory or CPU (currently define a constraint implementation in ASP)
- bugfix about edges yielded by ASP and multithreading parameter
- no statistics file to write by default
- timer for output writing
- config allow user to define the number of CPU for clingo to use
- simplify ASP code by removing useless arg in block/4 atoms
- 8.4
- replace ASP code constraint to achieve much more efficient grounding
- configuration allow for improved lowerbound computation of bicliques
- generated bubble allow client to give heading comments
- handle keyboard interruption during search with grace
- implement timers and statistics recording
- enable multishot motif search by default
- various bugfixes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
powergrasp-0.8.5.tar.gz
(18.2 kB
view hashes)
Built Distribution
powergrasp-0.8.5-py3-none-any.whl
(25.6 kB
view hashes)
Close
Hashes for powergrasp-0.8.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f95f93db9bf421ee17bc060fd6392c61e92f44af70de4d9200995f827466345 |
|
MD5 | 26449d54d788a158ac42d7f5398c512d |
|
BLAKE2b-256 | 2b793fec1bfb4c78acfebe0667851d4caa187427871a6e784c31675eaf762967 |