def add_forced(self, forced_vertices): """ Add forced vertices - must be selected """ for u in forced_vertices: self.__check_id(u) G.set_vertex_property(self, "forced", u, True)
def add_solved(self, solved_vertices): """ Add solved vertices - constraints operating only on solved vertices are dropped to avoid impossible situations """ for u in solved_vertices: self.__check_id(int(u)) G.set_vertex_property(self, "solved", u, True)
def set_partner(self, u, value, vals=None): assert (type(value) == int) assert (value < G.get_number_of_vertices(self)) if vals is None: G.set_vertex_property(self, "partner", u, value) else: G.set_vertex_property(self, "partner", 0, 0, vals=vals)
def set_cost(self, u, value): G.set_vertex_property(self, "costs", u, value)
def set_position(self, u, value): assert (type(value) == np.ndarray) assert (len(value) == 3) assert (value.ndim == 1) G.set_vertex_property(self, "position", u, value)
def solve_vertex(self, u): G.set_vertex_property(self, "solved", u, True)
def select_vertex(self, u): G.set_vertex_property(self, "selected", u, True)