Class MultivaluedDecisionDiagram


  • public class MultivaluedDecisionDiagram
    extends Object
    A Multi-valued Decision Diagram (MDD for short) to store

    Created by cprudhom on 30/10/14.

    • Field Detail

      • TERMINAL

        public static final int TERMINAL
        The terminal node. An extreme (likely unused) value is set
        See Also:
        Constant Field Values
    • Constructor Detail

      • MultivaluedDecisionDiagram

        public MultivaluedDecisionDiagram​(IntVar[] VARIABLES,
                                          Tuples TUPLES)
        Create an MDD based on an array of flatten domains and a set of tuples
        Parameters:
        VARIABLES - array of flatten domains
        TUPLES - set of (allowed) tuples
      • MultivaluedDecisionDiagram

        public MultivaluedDecisionDiagram​(IntVar[] VARIABLES,
                                          Tuples TUPLES,
                                          boolean compactOnce,
                                          boolean sortTuple)
        Create an MDD based on an array of flatten domains and a set of tuples
        Parameters:
        VARIABLES - array of flatten domains
        TUPLES - set of (allowed) tuples
        compactOnce - set to true to compact the MDD after having added all the TUPLES, set to false to try to compact the MDD after each tuple addition
        sortTuple - set to true to sort the TUPLES in increasing order before adding them
      • MultivaluedDecisionDiagram

        public MultivaluedDecisionDiagram​(int[][] FLATDOM,
                                          Tuples TUPLES)
        Create an MDD based on an array of flatten domains and a set of tuples
        Parameters:
        FLATDOM - array of flatten domains
        TUPLES - set of (allowed) tuples
      • MultivaluedDecisionDiagram

        public MultivaluedDecisionDiagram​(int[][] FLATDOM,
                                          Tuples TUPLES,
                                          boolean compactOnce,
                                          boolean sortTuple)
        Create an MDD based on an array of flatten domains and a set of tuples
        Parameters:
        FLATDOM - array of flatten domains
        TUPLES - set of (allowed) tuples
        compactOnce - set to true to compact the MDD after having added all the TUPLES, set to false to try to compact the MDD after each tuple addition
        sortTuple - set to true to sort the TUPLES in increasing order before adding them
      • MultivaluedDecisionDiagram

        public MultivaluedDecisionDiagram​(IntVar[] VARIABLES,
                                          int[][] TRANSITIONS)
        Create an MDD based on an array of flatten domains and a set of transitions. The first of the graph has to be labeled '0' and the last node of the graph has to be labeled '-1'. Then, a transition is triple which denotes an arc from node 'f' to node 't' valued to 'v'.
        Parameters:
        VARIABLES - array of flatten domains
        TRANSITIONS - list of transitions
    • Method Detail

      • addTuples

        public boolean addTuples​(Tuples TUPLES)
        Add all tuples within the MDD
        Parameters:
        TUPLES - tuples to add
      • addTuple

        public boolean addTuple​(int[] TUPLE)
        Add a tuple to the MDD
        Parameters:
        TUPLE - tuple to add
      • searchClosest

        protected int searchClosest​(int[] a,
                                    int key)
      • getDiagram

        public int[] getDiagram()
        Return the diagram (not a copy) of the MDD
      • getNodeSize

        public int getNodeSize​(int layer)
        Return the initial domain size of the variable in layer
        Parameters:
        layer - index of the variable
        Returns:
        original domain size
      • getOffset

        public int getOffset​(int layer)
        Return the initial LB of the variable in layer
        Parameters:
        layer - index of the variable
        Returns:
        original offset
      • getEdge

        public int getEdge​(int k)
        Return the edge valued in the k^th cell of the diagram
        Parameters:
        k - index of the cell
      • exists

        public boolean exists​(int... PATH)
        Return true is PATH has a support in the mdd
        Parameters:
        PATH - array of value
        Returns:
        true if PATH is valid