Download
language Essence 1.3
given numberNodes : int(1..)
given initialNode : int(1..numberNodes)
letting dNodes be domain int(1..numberNodes)
letting dDepths be domain dNodes
$ if a node has power link of 0 to another node, that link is not possible
given linkCosts : function (total) (dNodes,dNodes) --> int(0..)
find parents : function (total) dNodes --> dNodes
find depths : function (total) dNodes --> dDepths
such that
parents(initialNode) = initialNode
, forAll (child,parent) in parents .
(child != initialNode) ->
(parent != child /\ linkCosts((parent,child)) != 0)
such that forAll (child,parent) in parents .
child != initialNode -> depths(child) > depths(parent)
find optVar : int(0..numberNodes * max([cost | (_,cost) <- linkCosts]))
such that
optVar = sum parent : dNodes . max([ linkCosts((parent,child)) * toInt(parentI = parent)
| (child,parentI) <- parents
])
minimising optVar