https://github.com/d-krupke/cp-sat-log-analyzer

A webapp that visualizes and annotates your ortools' CP-SAT logs. Partially inspired by gurobi-logtools.

https://github.com/d-krupke/cp-sat-log-analyzer

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.8%) to scientific vocabulary

Keywords

cp-sat logs optimization ortools
Last synced: 5 months ago · JSON representation

Repository

A webapp that visualizes and annotates your ortools' CP-SAT logs. Partially inspired by gurobi-logtools.

Basic Info
Statistics
  • Stars: 45
  • Watchers: 5
  • Forks: 4
  • Open Issues: 9
  • Releases: 0
Topics
cp-sat logs optimization ortools
Created about 2 years ago · Last pushed 12 months ago
Metadata Files
Readme License

README.md

CP-SAT-Log-Analyzer

Dive into the world of constraint programming with ease using our CP-SAT Log Analyzer. This tool transforms the dense and detailed logs of CP-SAT into clear, readable formats, complemented by intuitive visualizations of key metrics. Whether you're tuning your model or exploring data, our analyzer simplifies and enlightens your journey with CP-SAT. Let us make complex logs simple and actionable!

Streamlit App

This project is not affiliated with Google.

Easy Upload

Various ways to quickly upload your log files, and multiple examples to get you started. If you have you log file uploaded somewhere, you can also create a link to it that you can share with others. There are some simple security measures in place to prevent abuse. Please let me know if they are too restrictive.

Upload

Overview

The overview page gives you a quick overview of the most important metrics of your log file.

Overview

Documentation

The logs are not only parsed and displayed, but also explained. Hovering over the question mark next to a metric will give you a short explanation of what it means. The individual parts of the log are annotated with a basic explanation.

Documentation

Plotting

Some important time series are plotted to give you a better understanding of what is going on in your log file. It is interactive, and you can zoom in and out. The hover-text gives you context on what you are looking at.

Plotting

Tabular Data

The log contains a lot of tabular data. We parse them into nice interactive tables.

Tabular Data

Contributing

We welcome contributions to this project. If you have any suggestions or encounter any bugs, please open an issue. If you want to contribute code, please open a pull request. We will review it as soon as possible.

Development

You can run this project locally by cloning it and running the following commands:

bash pip install -r requirements.txt streamlit run app.py

Project Structure

This project has a relatively simple structure, consisting of two main parts:

  1. The streamlit app with entry point app.py and implementation in ./_app.
  2. The parser and log documentation in cpsat_log_parser.

If you want to improve the parsing or documentation of a block of the log, you can do so by just editing the corresponding file in cpsat_log_parser/blocks. Every block has its own file with a name corresponding to the block name.

If you want to add a new block, you can do so by creating a new file in cpsat_log_parser/blocks. The file should contain a class with the same name as the block. This class should inherit from LogBlock and implement a static matches-method that returns True if the passed part of the log matches the block. The get_title and get_help methods should return a title and help text for the block. For tables, there already is a TableBlock which is able to return the table as a pandas DataFrame and the front-end will know to display it as a table. If your block is more complex and wants to display plots or other things, you will have to add a special section to the front-end. For the block to be found, you will also have to add it to the ALL_BLOCKS in cpsat_log_parser/blocks/__init__.py. The parser will then automatically try to use it. Note that the order of the list is important, as the first block that matches will be used. The LogBlock should always be the last as it matches everything.

Roadmap

Here are some ideas for future improvements:

  • [ ] Implement the ability to upload multiple log files and compare them.
  • [ ] Extend the documentation of the blocks. Currently, I only wrote some documentation for the most important blocks, sometimes by just copying from the CP-SAT Primer and letting ChatGPT quickly make it more readable.
  • [ ] A more extensive list of examples. I have some nice examples, where you can actually see issues in different parts of the log, highlighting their importance.

Authors

This project is developed by Dominik Krupke, Postdoctoral Researcher at the Algorithms Group of the Technische Universität Braunschweig. There is no funding for this project, and it is mainly developed in my free time. If you want to support this project, please consider contributing or contacting me for other ways to support it.

Related Projects

  1. OR-Tools: Google's Operations Research Tools containing the CP-SAT solver, for which this project was created.
  2. CP-SAT Primer: A primer on constraint programming with CP-SAT. This project was created to complement this primer.
  3. gurobi-logtools: Gurobi's log analyzer which is the inspiration for this project. However, this project is still very different from Gurobi's log analyzer.

Changes

  • 2024-10-31: Added a log history to quickly switch back to previous logs.
  • 2024-10-31: Fixed parsing when the model was solved in presolve.
  • 2024-09-05: Improved the parsing of the parameters.
  • 2024-09-05: No longer warn if status is OPTIMAL, but there is a gap, as CP-SAT considers everything as optimal if you specified a tolerance. This is different to other solvers. Don't want to confuse users.

Owner

  • Name: Dominik Krupke
  • Login: d-krupke
  • Kind: user
  • Location: Germany
  • Company: TU Braunschweig

Postdoc at TU Braunschweig, IBR, Algorithms Group.

GitHub Events

Total
  • Issues event: 4
  • Watch event: 10
  • Issue comment event: 20
  • Push event: 7
  • Pull request event: 4
  • Fork event: 3
Last Year
  • Issues event: 4
  • Watch event: 10
  • Issue comment event: 20
  • Push event: 7
  • Pull request event: 4
  • Fork event: 3

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 93
  • Total Committers: 2
  • Avg Commits per committer: 46.5
  • Development Distribution Score (DDS): 0.011
Past Year
  • Commits: 30
  • Committers: 2
  • Avg Commits per committer: 15.0
  • Development Distribution Score (DDS): 0.033
Top Committers
Name Email Commits
Dominik Krupke k****e@i****e 92
Alexander Ignatovich c****r@y****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 13
  • Total pull requests: 4
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 2 days
  • Total issue authors: 5
  • Total pull request authors: 3
  • Average comments per issue: 1.77
  • Average comments per pull request: 4.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 6
  • Pull requests: 4
  • Average time to close issues: 2 days
  • Average time to close pull requests: 2 days
  • Issue authors: 4
  • Pull request authors: 3
  • Average comments per issue: 2.17
  • Average comments per pull request: 4.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • d-krupke (9)
  • pchtsp (2)
  • leonlan (1)
  • ischmidt20 (1)
  • MarcelloTheArcane (1)
Pull Request Authors
  • oneSapling (2)
  • pchtsp (2)
  • CADBIMDeveloper (2)
Top Labels
Issue Labels
bug (3) good first issue (2) enhancement (1)
Pull Request Labels