Forwarding to the python-projects mailing list where such question should be 
asked!
People should probably think to Cc Mohamed if they have an answer.

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org
--- Begin Message ---
hello,
I need your help,
I use the  "logilab-constraint" package for solving a combinatorial problem
with constraints that are similar to the constraints of problem magic
square,

variables = []
domains={}
constraints=[]
for var in range(n*n):
            variables.append(var)
            domains[var]=fd.FiniteDomain([0,1,2,3])

#begin constraints

I try to express the following constraint:
the sum of each matrix row must be equal to 10
I expressed this constraint with python-constraint package as follows and
it works
for row in range(n):
    problem.addConstraint(ExactSumConstraint(10),
                         [row*n+i for i in range(n)])
but i like to express this constraint with the "python-logilab-constraint"

#end constraints

r = Repository(variables,domains,constraints)
solution=Solver().solve_one(r)
print solution

big thinks for you

--- End Message ---
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to