example: fix chemical_balance notebook

note: need to use """ to have our script correctly parsing
This commit is contained in:
Corentin Le Molgat
2022-12-21 09:54:01 +01:00
parent 757a8e884b
commit 928bfbfedb
4 changed files with 98 additions and 106 deletions

View File

@@ -11,14 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
'''
We are trying to group items in equal sized groups.
"""We are trying to group items in equal sized groups.
Each item has a color and a value. We want the sum of values of each group to
be as close to the average as possible.
Furthermore, if one color is an a group, at least k items with this color must
be in that group.
'''
be in that group."""
from ortools.linear_solver import pywraplp

View File

@@ -11,14 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
'''
We are trying to group items in equal sized groups.
"""We are trying to group items in equal sized groups.
Each item has a color and a value. We want the sum of values of each group to
be as close to the average as possible.
Furthermore, if one color is an a group, at least k items with this color must
be in that group.
'''
be in that group."""
import math
from ortools.sat.python import cp_model