Package: tdvisu
TdVisuVisualization fordynamic programmingontree decompositions.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 svganimatewould be an option in the future.UsingAlubbock:Graphviz(orGraphviz (>=2.38))python-benedictfor dpdb: psycopg2 (2.8.5)To register the graphviz pluginshttps://gitlab.com/graphviz/graphviz/-/issues/1352dot.exe-cTo installIn a command prompt with pip (to getpipsee:https://pip.pypa.io/en/stable/) installed:
Just runpipinstall-h(formoreinformationoninstalloptions)pipinstalltdvisuTo download the latest version from the default branch:gitclone--depth1--singlehttps://github.com/VaeterchenFrost/tdvisuTo isolate the dependenciesWithvirtualenvon the system installed you can isolate the environment, for examplevirtualenvtdvisu_dir-p3.8cdtdvisu_dir/bin/sourceactivateWithCondaon the system installed the dependencies for this project can be automatically installed in a new environment:Go to the projects base directory.Open aconda-command-promptwith admin privileges and run the commands from the project folderto create a new environment with basic dependencies:condaenvcreate-f.\environment.ymlto activate the environment:condaactivatetdvisuInstall from sourceTo clone the complete repository:gitclonehttps://github.com/VaeterchenFrost/tdvisuTo download only the latest version from the default branch:gitclone--depth1--singlehttps://github.com/VaeterchenFrost/tdvisuTo install the project from the source folder:pipinstall-h(formoreinformationoninstalloptions)pipinstall.to confirm that the visualization finds all dependencies:python.\tdvisu\visualization.py-hto run all tests:pipinstall.[test]pytest.\test\How to useThe visualization needs input in the form of theJson API.
The creation of this file is exemplary implemented inconstruct_dpdb_visu.pyor the forkGPUSATand--visufile filename(optionally disabling preprocessing with-p).Run the python file with the above dependencies installed:visualization.pyvisualization.pytakes two parameters, the json-infileto read from, and optionally oneoutputfolder.
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:TDStepthe tree decomposition with solved nodesPrimalGraphStepthe primal graph with currently active variables highlightedIncidenceGraphStepthe bipartite incidence graph with active clauses/variables highlightedThe graphs are images encoded in resolution independent.svg files(seehttps://www.lifewire.com/svg-file-4120603)How to use construct_dpdb_visu.pyAfter installing the projectdp_on_dbswith the there listedrequirements, we need toedit thedatabase.iniwith our password topostgresqlSolve a problem withpython dpdb.py [GENERAL-OPTIONS] -f <INPUT-FILE> <PROBLEM> [PROBLEM-SPECIFIC-OPTIONS]for the problemVertexCoverwith flag--gr-fileto store the htd Input (if the input was in a different format)for the problemSharpSatwith flag--store-formulato store the formula in the databaseRunSat/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.Installation of the psycopg2 packageSeehttps://www.psycopg.org/docs/install.html#build-prerequisitesFor example on linux today this might needsudo apt install libpq-devbefore completion.New ReleaseVersionBump/version.pyaccording to the changes madeChange date to the release day, keep formatRequirementsIn case dependencies have changed, or just to update some, checkrequirements.txtstable-requirements.txt(usingpip freeze)setup.pyWrite Changelog.mdAdd tag with link (see bottom for linking examples)Add changes, maybe some are already inUnreleasedUpdateUnreleasedwith(No) unreleased changesReview codeRun tests (pytest)Check codestyle (pylint)PushPush changes to masterWait for all automated checks! (All checks have passed...)Create ReleaseOn the GitHub page go to: Release,Draft a new releaseEnter v'YOUR VERSION NUMBER' as the tag.Add aRelease Title(could be just the version)Add some description (like in the CHANGELOG.md)Click onPublish releaseon the bottomShould automatically release toPyPIFor details see:Upload Python PackageNow you are set for the new release :tada:ChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelog, and this
project adheres toSemantic Versioning.UnreleasedNo unreleased changes yet.[1.1.9] - 2023-07-27Addedpython-benedict[xml]to dependenciesChangedUpdated requirements.txtUpdated stable-requirements.txt1.1.8- 2021-05-04ChangedUpdated pyyaml from 5.3.1 to 5.4#33Updated py from 1.9.0 to 1.10.0#35Fixed python-app.yml#341.1.7- 2020-09-13AddedBetter tests around the (Dimacs) ReaderChangedImproved the SQL queries with explicit formats#32Improved Readme sections for install and usage1.1.6- 2020-08-01AddedAdded better property based testing withhypothesis#29Added jobs and setups to test on macos and windows#31Changeddo_sort_nodesnow sorts in correct numeric order.commit cdfcf6Fixed some import orders1.1.5- 2020-07-17AddedAdded many new tests.Hints for not covered code lines.ChangedSimplified code to parse commandline flags while removing duplications in code.Entrypoint for modules visualization and construct_dpdb_visu is now in init().Some improvements in utilities.solution_node1.1.4- 2020-07-14AddedAdded the possibility to specify and create multiple graph-visualizations in one file#25Added test casetest_vc_multiple_and_joinincommit aa31901Added test cases forconstruct_dpdb_visuAdd pytest-mock to tests_requireChangedSimplified and refactored TDVisu.schema.jsonSchema now includes possibility to specify multiple instances of generalGraph and incidenceGraphRevisited doc/JsonAPI.md to now include all parameters availableRenamed test folder expected_images to expected_filesUpdated stable-requirements.txtSeveral minor improvements1.1.3- 2020-07-09AddedAddedTDVisu.schema.jsonto validate the Json-API for TDVisu#24Added 'col' to allowed formats in tw reader (default string in Mathematica)ChangedFixed error where database configuration was not found in the directoryFixed missing double quotation marks in JsonAPI.mdMoved JsonAPI.md →doc/JsonAPI.mdRemovedRemovedgeneralGraphandincidenceGraphfrom required arguments in API1.1.2- 2020-06-26AddedTests for visualization.py using graphviz in the Github Action tooTests for reader.pyChangedFixed typo that prevented joining SVG in visualizationFixed cases where logging.yml was not found in the working directoryNow using pathlib.Path for most file-related operationsUnified logging configuration in utilities and made it easier to work with#22Added more type hints and improved existing ones1.1.1- 2020-06-25AddedAdded problem typeSatto tdvisu/construct_dpdb_visu.pyAdded testcases in file test/test_dijkstra.pyChangedJsonAPI.md is now updated with snake_case names and consistent with visualization_data.pyFixed default value for svg-joinv_toptoNonefrom'top'Improved flexibility in several function parametersImproved documentation and comments in several placesFixed passing parameters to methodsetup_tree_dec_graphRemovedRemoved old dependency from  tdvisu/dijkstra.py on utilities1.1.0- 2020-06-07AddedAdded file utilities.py with several static or shared things likeConstants: CFG_EXT, LOGLEVEL_EPILOG, DEFAULT_LOGGING_CFGMethods:flattenread_yml_or_cfg combining yaml, json, cfg reader in onelogging_cfg configure logging with file or DEFAULT_LOGGING_CFGhelper convert_to_adj from dijkstra.pyadd_edge_to (edges and adj list)gen_arg infinite GeneratorStyles:base_style, emphasise_node, style_hide_node, style_hide_edgeGraph manipulation:bag_nodesolution_nodeAdded file logging.yml (and .ini) with logging configuration for the module#20Added half the tests for utilities.pyChangedChanged path of image SharpSatExample to the absolute URL forPyPI.Changed names of loggers to absolute name. Should be easy to adjust if needed.Changed logging defaults and config in tdvisu/visualization.py and construct_dpdb_visu.pyUpdated ArgumentParser helpSome fixes of code-style or variable names.1.0.1- 2020-06-04AddedCodecoverage withCodecovChangedChanged path of image SharpSatExample to the absolute URL forPyPI.1.0.0- 2020-06-04AddedAdded svgjoin parameters to JsonAPI#6Added call to svgjoin from visualization.pyAdded workflow to display the sourcecode-files inDIRECTORYChangedMoved JsonAPI and conda_packages to /docUpdated arguments in svgjoin to be more flexible for multiple joins#11Fixed scaling mechanism in svgjoin#13Changed tests from unittest to pytest#12RemovedChangelog in JsonAPI.md0.5.1- 2020-06-01AddedAdded publishing Action toPyPI#4ChangedChanged setup.py with more documentation and simpler functionality.Updated Readme with a guide on how to use construct_dpdb_visu#2RemovedRemoved publishing Action to testpypi#40.5.0-dev1- 2020-06-01AddedDevelopment version; beginning of the repository#1Added version.pyAdded module-name to importsAdded README to tdvisu directlyChangedFixed usage of__version__in tdvisu/construct_dpdb_visu.pyRemovedRemoved individual versioning