I think I would turn it upside down: I would use integers as nodes in the graph and maintain a mapping of these integers to their corresponding views. Is that possible?
Otherwise, things get hairy: you could hash on the variable implementation address to which the view is pointing to (if x is a view, then x.varimp() gives you that). But each time you clone, you would have to rehash as the varimp() changes. Christian -- Christian Schulte, www.ict.kth.se/~cschulte/ -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of David Rijsman Sent: Wednesday, February 13, 2013 11:36 AM To: [email protected] Subject: [gecode-users] Identifying a view Another question on how we can do this best. Imagine I have a precedence constraint: void Gecode::precedence(Home home, IntVar x, IntVar y, int lb, int ub, IntConLevel=ICL_DEF ) Post temporal propagator that maintains lb <= x - y <= ub This will invoke Precedence::post( Home home, View x, View y, int lb, int ub ) and this will update the shared handle to some shared distance graph. In the distance graph we maintain a graph which has vertices for each view. What is the best way of mapping a view to a vertex in this graph, that is how can identify a view to see if it already has been mapped into a vertex in for example a graph? Posting a new precedence constraint has to extend the graph with vertices for the views if they do not exist yet and add or update the edges between these vertices. any ideas? David J. Rijsman Algorithm Lead Quintiq T +31 (0)73 691 07 39 F +31 (0)73 691 07 54 M +31 (0)62 127 68 29 E [email protected] I www.quintiq.com _______________________________________________ Gecode users mailing list [email protected] https://www.gecode.org/mailman/listinfo/gecode-users _______________________________________________ Gecode users mailing list [email protected] https://www.gecode.org/mailman/listinfo/gecode-users
