Skip to content

API

Graph

Attributes col2
Graph.structure Graph structur represented as a matrix of nodes separated by level
Graph.actual_layer Represent the number of layers of de diagram
Methods Description
Graph.get_nodes_size() Representa la cantidad de nodos en el grafo
Graph.add_node(Node) Add a node to the graph
Graph.add_new_layer() Add a new layer to the graph
Graph.remove_not_active_nodes_down_top(layer_index) Remove not active nodes in layer, construction bottom_up
Graph.remove_not_active_nodes_top_down(layer_index) Remove not active nodes in layer, construction top_down

DD

Attributes Description
DD.problem An instance of the problem class, used to create the decision diagram.
Methods Description
DD.create_decision_diagram(verbose) -> void Creates the initial decision diagram and records the time taken
DD.create_reduce_decision_diagram(verbose) -> void Creates the reduced decision diagram and records the time taken.
DD.create_restricted_decision_diagram(verbose) -> void Creates the restricted decision diagram and records the time taken
DD.create_relaxed_decision_diagram(verbose) -> void Creates the relaxed decision diagram and records the time taken.
DD.print_decision_diagram()->str Prints the decision diagram for visualization, noting the limitation of a maximum of 4 different line types.
DD.export_graph_file(file_name)->void Exports the current decision diagram to a .GML file.
DD.get_decision_diagram_graph()-> Graph Returns the current decision diagram graph object
DD.get_decision_diagram_graph_copy()-> Graph Returns a copy of the decision diagram graph object, ensuring it is not a pointer to the original.
DD.get_dd_builder_time()->void Returns the execution time of the DDBuilder.
DD.get_reduce_dd_builder_time()->void Returns the execution time of the reduce constructor.
DD.get_restricted_dd_builder_time()->void Returns the execution time of the restricted constructor.
DD.get_relaxed_dd_builder_time()->void Returns the execution time of the relaxed constructor.

ObjectiveFunction

Attributes Description
ObjectiveFunction.graph_DD The decision diagram graph to be solved.
ObjectiveFunction.time Time taken to solve the decision diagram.
ObjectiveFunction.answer Structure that stores the solution of the objective function
Methods Description
ObjectiveFunction.set_objective_function(objective_function)->void Stores the necessary information to define an objective function.
ObjectiveFunction.solve_dd()->AnswerStructure Solves the decision diagram, returning the optimal solution.
ObjectiveFunction.get_time() -> str Returns the execution time of the solving algorithm.
ObjectiveFunction.get_the_solution -> AnswerStructure Returns the precomputed solution from solve_dd().

AbstractProblem

Attributes Description
problem.initial_state The initial state of the problem, which can be a list, integer, string, etc., depending on the specific problem requirements
problem.ordered_variables A list of variables sorted in the specific order that was given.
problem.variables_domain A dictionary mapping each variable to its domain.
Methods Description
problem.equals(State state_one, State state_two) -> bool Abstract method that must be implemented by subclasses to determine if two states are equal.
problem.transition_function(previus_state, variable_id, variable_value) -> (State state, bool feasibility) Abstract method that must be implemented by subclasses to define the transition function.
problem.get_priority_for_discard_node(state) -> int value Method that should be implemented by subclasses to define the priority function for discarding nodes.
problem.get_priority_for_merge_nodes(node_id, state) -> int value Method that should be implemented by subclasses to define the priority function for merging nodes.
problem.merge_operator(state_one, state_two) -> State state Method that should be implemented by subclasses to define the new state when two nodes are merged
problem.get_state_as_string(state) -> string state Method that should be implemented by subclasses to define a string representation of the state.

MaxFlow

Methods Description
MaxFlow.get_time() -> double Returns the execution time of the max-flow algorithm.
MaxFlow.get_max_flow() -> double Returns the precomputed values in the solve_max_flow() section.
MaxFlow.get_remaining_arcs_capacities() -> unordered_map<string, double> Returns the remaining capacities of the arcs in the graph.
MaxFlow.solve_max_flow(capacities) -> bool Solves the maximum flow problem in the graph with the provided arc capacities.
Returns a boolean indicating whether the solution was successfully found.

AbstractCut

Methods Description
Cut.get_time() -> double Returns the execution time of the cut algorithm.
Cut.get_cut() -> pair<vector<double, double>> Returns the precomputed values from the generate_cut() method.
Cut.generate_cut(x_values, verbose) -> bool Solves the decision diagram, finding a cut.
Returns a boolean indicating whether the solution was successfully found.

LiftCut

col1 Description
LiftCut.get_time() -> double Returns the execution time of the lift algorithm.
LiftCut.get_lift_cut() -> pair<vector<double, double>> Returns the precomputed values from the lift_cut() method.
LiftCut.lift_cut(coeficcients, constant) -> bool Lifts the cut by improving the coefficients and right-hand side value.
Returns a boolean indicating whether the solution was successfully found.