Skip to content

Features

Create Decision Diagram

To create the decision diagram, is necessary to use create_decision_diagram() from the DD class, whichsaved the graph class object when creating the diagram. This new version is then stored within the DD class.

Create Reduce Decision

To create the reduced decision diagram, is necessary to use create_reduce_decision_diagram() from the DD class, which transforms the graph class object saved when creating the diagram into its reduced form. This new version is then stored within the DD class.

Create Restricted Decision

To create the restricted decision diagram, is necessary to use create_restricted_decision_diagram() from the DD class, which transforms the graph class object saved when creating the diagram into its restricted form. This new version is then stored within the DD class.

Create Relax Decision

To create the relax decision diagram, is necessary to use create_relaxed_decision_diagram() from the DD class, which transforms the graph class object saved when creating the diagram into its relax form. This new version is then stored within the DD class.

For a quick visualization of the created diagram, can be use the print_decision_diagram() method of the DD class. It's important to note that this method uses the networkx library; therefore, it has a limitation of 5 different line types. If you have a variable domain greater than this, the design of the arcs will be repeated.

Warning

This functionality is only available in the Python version. For the corresponding visualization in C++, it is recommended to use Export Decision Diagram.

Export Decision Diagram

To export the created decision diagram, whether it's reduced or in its original format, should be use the export_graph_file() method of the DD class. This generates a .gml file that can be visualized in programs such as yED.

Get a Copy Of the Decision Diagram

To obtain a copy of the DD instance without it being a pointer to the original object, you should use the get_decision_diagram_graph_copy() method of the DD class. This feature can be useful for testing different constructors or functions to solve the diagram.

Solve the Decision Diagram

The first step to use this feature is to create an instance of the ObjectiveFunction, providing the dd_instance instance created earlier. Subsequently, it is necessary to create an instance of the algorithm to be used for solving the graph, which should receive a list with the weights of each variable in the objective function, and a string representing whether it is to maximize or minimize. The string values 'min' or 'max' can be used. For example, LinearObjectiveDP or SchedulingObjective. Finally, you should use the set_objective_function() method of the ObjectiveFunction class, providing the instance of the created algorithm. Subsequently, you can obtain the solution by using solve_dd() of the same class. Or if you already solve the graph and you only one to recover this information, can use get_the_solution().

Obtaining the Maximum Flow of the Decision Diagram

The MaxFlow class is responsible for solving the maximum flow problem in a graph using the Ford-Fulkerson algorithm. It seeks to find the maximum flow that can pass through a graph from a starting node to an end node.

To obtain the maximum flow of the decision diagram, it is first necessary to create an instance of the MaxFlow class, providing the dd_instance instance created earlier. Then, by using the solve_max_flow() method and providing the maximum capacities for each arc, you will get a float that represents the maximum flow of the diagram. It's also possible to obtain the remaining capacities of the arcs using get_remaining_arcs_capacities().

Get a Cut of the Decision Diagram

To obtain a linear cut of a graph, you should use the CombinatorialCut or the DualCut providing the dd_instance, created earlier, in the instantiation of the class. Then, use the generate_cut() function, which takes the values of the variables and a constant as inputs. This function returns a boolean indicating whether the cut was found or not. Finally, to obtain the cut, use the get_cut() method, and if you want the minimum cut, use the get_min_cut() method of the CombinatorialCut class

Get a lift cut of the Decision Diagram

To lift a cut, it is necessary to use the LiftCut class, which should be provided the dd_instance created earlier during instantiation. Then, the lift_cut() method should be used, to which a valid cut for the diagram must be provided. This method returns a boolean indicating whether the lifting of the cut was successful. If so, the get_lift_cut() method should be used to obtain the new inequality.

Get the Time of the Algorithms

If it's want to get the time taken by the algorithms for creating the diagram or another of its forms, you need to use the get_dd_builder_time() or get_TYPE_constructor_time() methods of the DD class, where TYPE represent the type of graph that its wanted, for example relax, restricted or reduce. On the other hand, to obtain the objective function time, you should use get_time() from the ObjectiveFunction class. The same function should be used to obtain the time of the algorithms associated with the cuts, from their respective classes.