Skip to main content

Visualizing Dynamic Programming on Tree Decompositions.

Project description

TdVisu

Tests Upload Python Package TEST

Visualization for dynamic programming on tree decompositions. Create a graph object for each desired graph that is of interest for the dynamic programming. Then the visualization generates highlights and adds additional solutions for user-defined time steps. These snapshots of graphs get written in a supported file-format to a any folder. 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' the images are highly customizable, and even combining several timesteps together using svg animate would be an option.

Using

Alubbock:Graphviz (or Graphviz (>=2.38))

python-benedict

for dpdb: psycopg2 (2.8.5)

How to install

After downloading the latest verion, go to the source-directory.

With Conda 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:

conda env create -f .\environment.yml

to create a new environment with basic dependencies

conda activate tdvisu

to activate the environment

dot.exe -c

to register the plugins

pip install --pre .

to install the project in the environment (currently in pre-release, to get pip see: https://anaconda.org/anaconda/pip)

python .\tdvisu\visualization.py -h

to confirm that the visualization finds all dependencies.

pip install .[test] 
python -m unittest

to run all tests.

How to use

The visualization needs input in the form of the Json API. The creation of this file is exemplary implemented in construct_dpdb_visu.py or the fork GPUSAT and --visufile filename (optionally disabling preprocessing with -p).

Run the python file with the above dependencies installed: 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:

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
  • IncidenceGraphStep the bipartite incidence graph with active clauses/variables

Currently the graphs are images encoded in resolution independent .svg files (see https://www.lifewire.com/svg-file-4120603)

Example SharpSat

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

  • Removed individual versioning
  • Added version.py
  • Added module-name to imports
  • Added README to tdvisu directly

0.5.0 - 2020-06-01

Added

  • Current development version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tdvisu-0.5.0.dev3.tar.gz (31.5 kB view hashes)

Uploaded Source

Built Distribution

tdvisu-0.5.0.dev3-py3-none-any.whl (54.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page