Metadata-Version: 2.1
Name: tdvisu
Version: 1.0.0
Summary: Visualizing Dynamic Programming on Tree Decompositions.
Home-page: https://github.com/VaeterchenFrost/tdvisu
Author: Martin Röbke
Author-email: martin.roebke@mailbox.tu-dresden.de
License: GPLv3
Description: # TdVisu
        ![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)
        ![Tests](https://github.com/VaeterchenFrost/tdvisu/workflows/Tests/badge.svg) 
        [![PyPI license](https://img.shields.io/pypi/l/tdvisu.svg)](https://pypi.python.org/pypi/tdvisu/)
        
        ![GitHub release (latest SemVer including pre-releases)](https://img.shields.io/github/v/release/vaeterchenfrost/tdvisu?include_prereleases)
        [![PyPI version fury.io](https://badge.fury.io/py/tdvisu.svg)](https://pypi.python.org/pypi/tdvisu/)
        [![PyPI status](https://img.shields.io/pypi/status/tdvisu.svg)](https://pypi.python.org/pypi/tdvisu/)
        [![PyPI pyversions](https://img.shields.io/pypi/pyversions/tdvisu.svg)](https://pypi.python.org/pypi/tdvisu/)
        ![PyPI - Wheel](https://img.shields.io/pypi/wheel/tdvisu)
        ![GitHub repo size](https://img.shields.io/github/repo-size/VaeterchenFrost/tdvisu)
        ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/VaeterchenFrost/tdvisu)
        ![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/VaeterchenFrost/tdvisu/latest)
        
        
        
        Visualization for [dynamic programming](https://en.wikipedia.org/wiki/Dynamic_programming) on [tree decompositions](https://en.wikipedia.org/wiki/Tree_decomposition).
        
        Create a graph object for each given graph that is of interest for the dynamic programming.
        
        The visualization generates highlights and adds solution-tables for user defined time steps.
        
        These snapshot of the graphs will be written in a graphviz-supported file-format to a folder of your choosing.
        
        For the portable and light weight '.svg' format, all graphs for a timestep can be joined together to provide a thoroughly view on the process of dynamic programming.
        
        With the '.svg' format the images are highly customizable, and even combining several timesteps together using svg [animate](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animate) would be an option in the future.
        
        
        # Using
        [Alubbock:Graphviz](https://anaconda.org/alubbock/graphviz) (or [Graphviz (>=2.38)](https://graphviz.gitlab.io/download/))
        
        [python-benedict](https://pypi.org/project/python-benedict/)
        
        [for dpdb: psycopg2 (2.8.5)](https://www.psycopg.org/docs/index.html)
        
        # How to install
        
        After downloading the latest verion, go to the source-directory. 
        
        With [Conda](https://docs.conda.io/en/latest/) on the system installed, the dependencies for this project can be automatically installed in a new environment - or in a place of your choosing:
        
        Open a *conda-command-prompt* with admin privileges and run the commands from the *gpusat-VISU\tdvisualization_repo* folder:
        to create a new environment with basic dependencies:
        ```shell
        conda env create -f .\environment.yml
        ```
        to activate the environment:
        ```shell
        conda activate tdvisu
        ```
        to register the graphviz plugins:
        ```shell
        dot.exe -c
        ```
        to install the project in the environment: (to get *pip* see: https://pip.pypa.io/en/stable/)
        ```shell
        pip install -h (for more information on install options)
        pip install .
        ```
        to confirm that the visualization finds all dependencies:
        ```shell
        python .\tdvisu\visualization.py -h
        ```
        to run all tests:
        ```shell
        pip install .[test] 
        pytest .\test\
        ```
        
        
        # How to use
        
        The visualization needs input in the form of the [Json API](https://github.com/VaeterchenFrost/gpusat-VISU/blob/master/JsonAPI_v1.3.md).
        The creation of this file is exemplary implemented in *construct_dpdb_visu.py* or the fork [GPUSAT](https://github.com/VaeterchenFrost/GPUSAT) and *--visufile filename* (optionally disabling preprocessing with *-p*).
        
        Run the python file with the above dependencies installed:
        [visualization.py](https://github.com/VaeterchenFrost/gpusat-VISU/blob/master/satvisualization_repo/satvisu/visualization.py)
        
        **visualization.py** takes two parameters, the json-**infile** to read from, and optionally one **outputfolder**.
        With both arguments a call from IPython might look like this:
        
        ```python
        runfile('visualization.py', 
        args='visugpusat.json examplefolder')
        ```
        
        For #SAT it produces for example three different graphs suffixed with a running integer to represent timesteps:
        
        + *TDStep* the tree decomposition with solved nodes
        + *PrimalGraphStep* the primal graph with currently active variables highlighted
        + *IncidenceGraphStep* the bipartite incidence graph with active clauses/variables highlighted
        
        The graphs are images encoded in resolution independent **.svg files** (see https://www.lifewire.com/svg-file-4120603)
        
        <p align="center"><img src="doc/images/combined6DA4.svg" width="70%"/></p>
        
        ## How to use construct_dpdb_visu.py
        After installing the project [dp_on_dbs](https://github.com/hmarkus/dp_on_dbs) with the there listed [requirements](https://github.com/hmarkus/dp_on_dbs#requirements), we need to
        - edit the [database.ini](https://github.com/VaeterchenFrost/tdvisu/blob/master/tdvisu/database.ini) with our password to [postgresql](https://www.postgresql.org/)
        - Solve a problem with `python dpdb.py [GENERAL-OPTIONS] -f <INPUT-FILE> <PROBLEM> [PROBLEM-SPECIFIC-OPTIONS]`
          - for the problem **VertexCover** 
            - with flag `--gr-file` to store the htd Input (if the input was in a different format)
          - for the problem **SharpSat**
            - with flag `--store-formula` to store the formula in the database
        - Run 
          - **SharpSat**: `python construct_dpdb_visu.py [PROBLEMNUMBER]`
          - **VertexCover**: `python construct_dpdb_visu.py [PROBLEMNUMBER] --twfile [TWFILE]` 
           with the file in DIMACS tw-format containing the edges of the graph.
        
        # New Release
        
        ## Version
        - Bump `/version.py` according to the changes made
        - Change date to the release day, keep format 
        
        ## Requirements
        In case any dependencies changed, or just to update some, check in
        - *requirements.txt*
        - *stable-requirements.txt* (using `pip freeze`)
        - *setup.py* (only `tests_require = ['pytest']` right now)
        
        ## Write Changelog.md
        - Add tag with link (see bottom for linking examples)
        - Add changes, maybe some are already in *Unreleased*
        - Update *Unreleased* with **(No) unreleased changes**
        
        ## Review code
        - Run tests (pytest)
        - Check codestyle (pylint)
        
        ## Push
        - Push changes to master
        - Wait for all automated checks! (All checks have passed...)
        
        ## Create Release
        - On the GitHub page go to: Release, **[Draft a new release](https://github.com/VaeterchenFrost/tdvisu/releases/new )** 
        - Enter v'YOUR VERSION NUMBER' as the tag.
        - Add a **Release Title** (could be just the version)
        - Add some description (like in the CHANGELOG.md)
        - Click on **Publish release** on the bottom
        
        ## Should automatically release to [PyPI]
        - For details see: [Upload Python Package](https://github.com/VaeterchenFrost/tdvisu/blob/master/.github/workflows/python-app.yml )
        
        **Now you are set for the new release :tada:**
        
        # Changelog
        
        All notable changes to this project will be documented in this file.
        
        The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/ ), and this
        project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html ).
        
        ## [Unreleased]
        
        No unreleased changes yet.
        
        ## [1.0.0] - 2020-06-04
        ### Added
        - Added svgjoin parameters to JsonAPI [#6]
        - Added call to svgjoin from visualization.py
        - Added workflow to display the sourcecode-files in [DIRECTORY]
        
        ### Changed 
        - Moved JsonAPI and conda_packages to /doc
        - Updated arguments in svgjoin to be more flexible for multiple joins [#11]
        - Fixed scaling mechanism in svgjoin [#13]
        - Changed tests from unittest to pytest [#12]
        
        ### Removed
        - Changelog in JsonAPI.md
        
        ## [0.5.1] - 2020-06-01
        ### Added
        - Added publishing Action to [PyPI] [#4]
        
        ### Changed
        - Changed setup.py with more documentation and simpler functionality.
        - Updated Readme with a guide on how to use construct_dpdb_visu [#2]
        
        ### Removed
        - Removed publishing Action to testpypi [#4]
        
        
        ## [0.5.0-dev1] - 2020-06-01
        
        ### Added
        
        - Development version; beginning of the repository [#1]
        - Added version.py
        - Added module-name to imports
        - Added README to tdvisu directly
        
        ### Changed
        - Fixed usage of `__version__` in tdvisu/construct_dpdb_visu.py
        
        ### Removed
        - Removed individual versioning 
        
        [#1]: https://github.com/VaeterchenFrost/tdvisu/issues/1
        [#2]: https://github.com/VaeterchenFrost/tdvisu/issues/2
        [#4]: https://github.com/VaeterchenFrost/tdvisu/issues/4
        [#6]: https://github.com/VaeterchenFrost/tdvisu/issues/6
        [#11]: https://github.com/VaeterchenFrost/tdvisu/issues/11
        [#12]: https://github.com/VaeterchenFrost/tdvisu/issues/12
        [#13]: https://github.com/VaeterchenFrost/tdvisu/issues/13
        
        [@VaeterchenFrost]: https://github.com/VaeterchenFrost
        [PyPI]: https://pypi.org/project/tdvisu/
        [mypy]: https://github.com/python/mypy
        [DIRECTORY]: https://github.com/VaeterchenFrost/tdvisu/blob/master/DIRECTORY.md
        
        [Unreleased]: https://github.com/VaeterchenFrost/tdvisu/compare/v1.0.0...master
        [1.0.0]: https://github.com/VaeterchenFrost/tdvisu/releases/tag/v1.0.0
        [0.5.1]: https://github.com/VaeterchenFrost/tdvisu/releases/tag/v0.5.1
        [0.5.0-dev1]: https://github.com/VaeterchenFrost/tdvisu/releases/tag/v0.5.0-dev1
        
Keywords: graph visualization dynamic-programming msol-solver
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Multimedia :: Graphics :: Presentation
Description-Content-Type: text/markdown
Provides-Extra: test
