Lately, I have been working on a CP-SAT model for solving multi-resource flexible job shop problems.
I used the code (1) as an inspiration for building code (2) in Python which works well. Then I had to recode (2) in C# which gave me code (3).
When I feed same data set in 2 and 3 I get different results and I have very hard time explaining it to me. It could definitely be my code but I spend the whole afternoon without finding the mistake.
(1) https://github.com/google/or-tools/blob/stable/examples/python/flexible_job_shop_sat.py
(2) https://github.com/ozizi1/MultiResourceFJSP/blob/master/Python_MR-FJSP
(3) https://github.com/ozizi1/MultiResourceFJSP/blob/master/Cs_MR-FJSP
EDIT:
Following Laurent Perron's recommandation bellow I kept on looking and to me both models seem correct. They both try to minimize makespan and they both respect no overlap and precedence constraints in the results displayed.
Once again this could be my model but I really don't see the issue.
Another weird phenomena is that code 2 and 3 can choose same alternatives but give different objective values :
If you want to replicate this behaviour just change second's alternative lead time on github's code by 9 so that jobs start like : [[[[3, (0,1)],[9, (1,2)]...
Also please notice the difference in wall times. If I didn't had to use WPF - MVVM design pattern I would have stuck to Python.
If you have any idea where this is coming from please let me know.