undirected acyclic graph constraint?

11 views
Skip to first unread message

Andrew Gill

unread,
Oct 13, 2025, 4:24:53 AMOct 13
to MiniZinc
Hi All - I have an optimisation problem with a set of k+1 strictly increasing positive integer decision variables where I want to minimize the (k+1)th decision variable. The set of decision variables generates an undirected graph with no more than k^2+1 vertices and O(k^2) edges, and the constraint is that this undirected graph contains no cycles (i.e., is acyclic). I would like to be able to solve for problems of size k=20.

Has there been a "constraint acyclic(G)" been developed in MiniZinc, where G is an undirected graph? 

And what forms would my 'graph variables' take? At the moment, my decision variables generate a k by k positive integer matrix A, where the vertices would be the unique integer values in A and an additional vertex with value 0, and undirected edges exist between A[i,j] and A[j,i] for all i != j, and between A[j,j] and 0 for all j. 

Finally, between an alldifferent(S) and an acyclic(G) constraint, with both S and G of comparable 'size' O(k^2), is one 'quicker' in finding the optimal solution?

Thanks for any assistance!

Andrew
Reply all
Reply to author
Forward
0 new messages