Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to inspect defined constraints in python?

Is there any way to inspect model and see what constraints have been defined?

For instance, https://github.com/google/or-tools/blob/stable/examples/python/sudoku_sat.py defines the following:

# AllDifferent on rows.
for i in line:
    model.AddAllDifferent(grid[(i, j)] for j in line)

Does this create some observable entity in model (e.g. i number of entity-constraints)?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can scan the underlying cp_model protobuf.

see model.Proto()

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading