|
grphbase.c File Reference Detailed Descriptionincludes several methodes for Steiner problem graphs This file contains several basic methods to process Steiner problem graphs. A graph can not be reduced in terms of edge or node size, but edges can be marked as EAT_FREE (to not be used anymore) and nodes may have degree one. The method 'graph_pack()' can be used to build a new graph that discards these nodes and edges. Definition in file grphbase.c. #include "scip/misc.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>#include "portab.h"#include "misc_stp.h"#include "grph.h"Go to the source code of this file.
Function Documentation
used by graph_grid_create Definition at line 336 of file grphbase.c. References getNodeNumber(). Referenced by graph_grid_create().
used by graph_obstgrid_create Definition at line 266 of file grphbase.c. References FALSE, getNodeNumber(), and TRUE. Referenced by graph_obstgrid_create().
Definition at line 1928 of file grphbase.c. References GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, GRAPH::oeat, GRAPH::outbeg, and GRAPH::tail. Referenced by graph_edge_del(), and graph_edge_hide().
used by graph_grid_create Definition at line 237 of file grphbase.c. Referenced by compEdges(), compEdgesObst(), graph_grid_create(), and graph_obstgrid_create(). copy the graph
Definition at line 1228 of file grphbase.c. References GRAPH::cost, GRAPH::edges, GRAPH::esize, GRAPH::flags, GRAPH::grad, graph_init(), graph_valid(), GRAPH::grid_coordinates, GRAPH::grid_dim, GRAPH::grid_ncoords, GRAPH::head, GRAPH::hoplimit, GRAPH::ieat, GRAPH::inpbeg, GRAPH::knots, GRAPH::ksize, GRAPH::layers, GRAPH::locals, GRAPH::mark, GRAPH::maxdeg, GRAPH::norgmodeledges, GRAPH::norgmodelknots, GRAPH::oeat, GRAPH::orgedges, GRAPH::orgknots, GRAPH::outbeg, GRAPH::prize, GRAPH::source, STP_DEG_CONS, STP_GRID, STP_MAX_NODE_WEIGHT, STP_PRIZE_COLLECTING, STP_ROOTED_PRIZE_COLLECTING, GRAPH::stp_type, GRAPH::tail, GRAPH::term, and GRAPH::terms. Referenced by graph_PcSapCopy(), and SCIP_DECL_PROBCOPY().
add a new edge to the graph
Definition at line 1879 of file grphbase.c. References GRAPH::cost, GRAPH::edges, GRAPH::esize, GRAPH::grad, GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, GRAPH::oeat, GRAPH::outbeg, GRAPH::tail, and UNKNOWN. Referenced by graph_grid_create(), graph_obstgrid_create(), graph_pack(), graph_PcSapCopy(), graph_PcToSap(), graph_prize_transform(), graph_rootprize_transform(), and pcgraphtrans().
delete an edge
Definition at line 1965 of file grphbase.c. References GRAPH::ancestors, EAT_FREE, EAT_HIDE, Edge_anti, edge_remove(), GRAPH::grad, GRAPH::head, GRAPH::ieat, GRAPH::oeat, SCIPintListNodeFree(), and GRAPH::tail. Referenced by ansadv2Reduction(), ansadvReduction(), ansReduction(), bd3_reduction(), bdr_reduction(), bound_reduce(), chain2Reduction(), cnsAdvReduction(), da_reduce(), daPc_reduce(), degree_test_hc(), degree_test_mw(), degree_test_pc(), degree_test_sap(), deleteterm(), graph_edge_redirect(), graph_knot_contract(), graph_knot_contractpc(), hcrbound_reduce(), hcrcbound_reduce(), hopbound_reduce(), ledge_reduction(), level0(), nnpReduction(), npvReduction(), nvsl_reduction(), sd2_reduction(), sd_red(), sd_reduction(), sdpc_reduction(), sdsp_reduction(), sdsp_sap_reduction(), traverseChain(), and trydg1edgepc().
hide edge
Definition at line 2015 of file grphbase.c. References EAT_FREE, EAT_HIDE, edge_remove(), GRAPH::grad, GRAPH::head, GRAPH::ieat, GRAPH::oeat, and GRAPH::tail.
Definition at line 1783 of file grphbase.c. References GRAPH::cost, EAT_FREE, EAT_LAST, Edge_anti, FALSE, GRAPH::grad, graph_edge_del(), GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, GRAPH::oeat, GRAPH::outbeg, and GRAPH::tail. Referenced by bd3_reduction(), degree_test_pc(), graph_edge_reinsert(), graph_PcSapCopy(), and traverseChain().
reinsert an edge to replace two other edges
Definition at line 1846 of file grphbase.c. References GRAPH::ancestors, Edge_anti, graph_edge_redirect(), SCIPintListNodeAppendCopy(), and SCIPintListNodeFree(). Referenced by bd3_reduction(), bdr_reduction(), bound_reduce(), and da_reduce().
set flags
Definition at line 1307 of file grphbase.c. References GRAPH::flags. Referenced by graph_load().
free the graph
Definition at line 1137 of file grphbase.c. References GRAPH::ancestors, GRAPH::cost, GRAPH::edges, GRAPH::fixedges, GRAPH::grad, GRAPH::grid_coordinates, GRAPH::grid_dim, GRAPH::grid_ncoords, GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, GRAPH::locals, GRAPH::mark, GRAPH::maxdeg, GRAPH::norgmodelknots, GRAPH::oeat, GRAPH::orghead, GRAPH::orgtail, GRAPH::outbeg, Int_List_Node::parent, GRAPH::pcancestors, GRAPH::prize, GRAPH::source, STP_DEG_CONS, STP_GRID, GRAPH::stp_type, GRAPH::tail, and GRAPH::term. Referenced by bd3_reduction(), bdr_reduction(), bound_reduce(), daPc_reduce(), graph_pack(), hopbound_reduce(), ledge_reduction(), npvReduction(), pcgraphtrans(), SCIP_DECL_HEUREXEC(), SCIP_DECL_PROBDELORIG(), SCIPdualAscentPcStp(), SCIPheurImproveSteinerTree(), sd_red(), and sdpc_reduction().
computes coordinates of node 'node'
Definition at line 691 of file grphbase.c. Referenced by SCIPprobdataWriteSolution().
creates a graph out of a given grid
Definition at line 535 of file grphbase.c. References compEdges(), getNodeNumber(), graph_edge_add(), graph_init(), graph_knot_add(), graph_knot_chg(), GRAPH::grid_coordinates, GRAPH::grid_dim, GRAPH::grid_ncoords, GRAPH::source, STP_GRID, and GRAPH::stp_type. Referenced by graph_load().
Definition at line 1341 of file grphbase.c. References GRAPH::cost, GRAPH::edges, GRAPH::grad, GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, GRAPH::knots, GRAPH::oeat, GRAPH::outbeg, GRAPH::tail, and GRAPH::term.
initalize a graph
Definition at line 44 of file grphbase.c. References GRAPH::ancestors, GRAPH::cost, GRAPH::edges, GRAPH::esize, GRAPH::fixedges, GRAPH::flags, GRAPH::grad, GRAPH::grid_coordinates, GRAPH::grid_ncoords, GRAPH::head, GRAPH::hoplimit, GRAPH::ieat, GRAPH::inpbeg, GRAPH::knots, GRAPH::ksize, GRAPH::layers, GRAPH::locals, GRAPH::mark, GRAPH::maxdeg, GRAPH::mincut_dist, GRAPH::mincut_e, GRAPH::mincut_head, GRAPH::mincut_next, GRAPH::mincut_numb, GRAPH::mincut_prev, GRAPH::mincut_r, GRAPH::mincut_temp, GRAPH::mincut_x, GRAPH::norgmodeledges, GRAPH::norgmodelknots, GRAPH::oeat, GRAPH::orgedges, GRAPH::orghead, GRAPH::orgknots, GRAPH::orgtail, GRAPH::outbeg, GRAPH::path_heap, GRAPH::path_state, GRAPH::pcancestors, GRAPH::prize, GRAPH::source, GRAPH::stp_type, GRAPH::tail, GRAPH::term, GRAPH::terms, and UNKNOWN. Referenced by bd3_reduction(), bdr_reduction(), bound_reduce(), buildsolgraph(), graph_copy(), graph_grid_create(), graph_load(), graph_obstgrid_create(), graph_pack(), hopbound_reduce(), ledge_reduction(), npvReduction(), pcgraphtrans(), SCIPheurImproveSteinerTree(), sd_red(), and sdpc_reduction().
initialize data structures required to keep track of reductions
Definition at line 128 of file grphbase.c. References GRAPH::ancestors, GRAPH::edges, GRAPH::head, GRAPH::knots, GRAPH::orghead, GRAPH::orgtail, GRAPH::pcancestors, STP_MAX_NODE_WEIGHT, STP_PRIZE_COLLECTING, STP_ROOTED_PRIZE_COLLECTING, GRAPH::stp_type, and GRAPH::tail. Referenced by daPc_reduce(), and reduce().
add a vertex
Definition at line 1362 of file grphbase.c. References EAT_LAST, GRAPH::grad, GRAPH::inpbeg, Is_term, GRAPH::knots, GRAPH::ksize, GRAPH::locals, GRAPH::mark, GRAPH::outbeg, GRAPH::term, GRAPH::terms, and TRUE. Referenced by bd3_reduction(), bdr_reduction(), buildsolgraph(), graph_grid_create(), graph_load(), graph_obstgrid_create(), graph_pack(), graph_PcSapCopy(), graph_PcToSap(), graph_prize_transform(), graph_rootprize_transform(), ledge_reduction(), npvReduction(), pcgraphtrans(), SCIPheurImproveSteinerTree(), sd_red(), sdpc_reduction(), and voronoi_radius().
change terminal property of a vertex
Definition at line 1386 of file grphbase.c. References Is_term, GRAPH::locals, GRAPH::term, and GRAPH::terms. Referenced by bound_reduce(), deleteterm(), graph_grid_create(), graph_knot_contract(), graph_knot_contractpc(), graph_load(), graph_maxweight_transform(), graph_MwcsToSap(), graph_obstgrid_create(), graph_PcToSap(), graph_prize_transform(), graph_rootprize_transform(), hopbound_reduce(), pcgraphorg(), pcgraphtrans(), sd_red(), and trydg1edgepc().
contract an edge, given by its endpoints
Definition at line 1415 of file grphbase.c. References GRAPH::ancestors, GRAPH::cost, EAT_LAST, Edge_anti, FALSE, GRAPH::grad, graph_edge_del(), graph_knot_chg(), GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, Is_term, GRAPH::layers, GRAPH::oeat, GRAPH::outbeg, SCIPintListNodeAppendCopy(), SCIPintListNodeFree(), GRAPH::source, GRAPH::tail, GRAPH::term, TRUE, and UNKNOWN. Referenced by bd3_reduction(), degree_test(), degree_test_pc(), degree_test_sap(), graph_knot_contractpc(), nv_reduction(), nv_reductionAdv(), nvsl_reduction(), rptReduction(), and sl_reduction().
contract an edge of (rooted) prize-collecting Steiner tree problem
Definition at line 1679 of file grphbase.c. References GRAPH::ancestors, GRAPH::cost, EAT_LAST, GRAPH::grad, graph_edge_del(), graph_knot_chg(), graph_knot_contract(), GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, Is_pterm, Is_term, GRAPH::mark, GRAPH::oeat, GRAPH::outbeg, GRAPH::pcancestors, GRAPH::prize, prize_subtract(), SCIPintListNodeAppendCopy(), SCIPintListNodeFree(), GRAPH::source, STP_MAX_NODE_WEIGHT, GRAPH::stp_type, GRAPH::tail, GRAPH::term, and TRUE. Referenced by degree_test_mw(), degree_test_pc(), nv_reduction(), nv_reductionAdv(), sl_reduction(), and trydg1edgepc().
alters the graph for MWCS problems
Definition at line 1020 of file grphbase.c. References GRAPH::cost, EAT_LAST, graph_knot_chg(), graph_prize_transform(), GRAPH::ieat, GRAPH::inpbeg, Is_term, GRAPH::knots, GRAPH::prize, STP_MAX_NODE_WEIGHT, GRAPH::stp_type, GRAPH::term, and GRAPH::terms. Referenced by graph_load().
tansforms an MWCSP to an SAP
Definition at line 1079 of file grphbase.c. References GRAPH::cost, EAT_LAST, graph_knot_chg(), graph_PcToSap(), GRAPH::ieat, GRAPH::inpbeg, Is_term, GRAPH::knots, GRAPH::prize, STP_MAX_NODE_WEIGHT, GRAPH::stp_type, GRAPH::term, and GRAPH::terms. Referenced by graph_load().
creates a graph out of a given grid
Definition at line 374 of file grphbase.c. References compEdgesObst(), FALSE, getNodeNumber(), graph_edge_add(), graph_init(), graph_knot_add(), graph_knot_chg(), graph_pack(), GRAPH::grid_coordinates, GRAPH::grid_dim, GRAPH::grid_ncoords, GRAPH::source, STP_OBSTACLES_GRID, GRAPH::stp_type, and TRUE. Referenced by graph_load(). pack the graph, i.e. build a new graph that discards deleted edges and nodes
Definition at line 2342 of file grphbase.c. References GRAPH::ancestors, GRAPH::cost, EAT_FREE, Edge_anti, GRAPH::edges, FALSE, FARAWAY, GRAPH::fixedges, GRAPH::flags, GRAPH::grad, graph_edge_add(), graph_free(), graph_init(), graph_knot_add(), graph_valid(), GRAPH::grid_coordinates, GRAPH::grid_dim, GRAPH::grid_ncoords, GRAPH::head, GRAPH::hoplimit, GRAPH::ieat, Is_term, GRAPH::knots, GRAPH::layers, GRAPH::maxdeg, GRAPH::norgmodeledges, GRAPH::norgmodelknots, GRAPH::oeat, GRAPH::orgedges, GRAPH::orghead, GRAPH::orgknots, GRAPH::orgtail, GRAPH::pcancestors, GRAPH::prize, SCIPintListNodeAppendCopy(), SCIPintListNodeFree(), GRAPH::source, STP_MAX_NODE_WEIGHT, STP_PRIZE_COLLECTING, STP_ROOTED_PRIZE_COLLECTING, GRAPH::stp_type, GRAPH::tail, GRAPH::term, GRAPH::terms, and UNKNOWN. Referenced by graph_obstgrid_create(), SCIP_DECL_HEUREXEC(), and SCIPprobdataCreate(). alters the graph for prize collecting problems
Definition at line 792 of file grphbase.c. References GRAPH::cost, EAT_LAST, GRAPH::edges, GRAPH::esize, FARAWAY, flipedge, graph_copy(), graph_edge_add(), graph_edge_redirect(), graph_knot_add(), graph_resize(), Is_pterm, Is_term, GRAPH::knots, GRAPH::ksize, GRAPH::prize, GRAPH::source, STP_DIRECTED, GRAPH::stp_type, GRAPH::term, and GRAPH::terms. Referenced by daPc_reduce(), and SCIPdualAscentPcStp().
alters the graph for prize collecting problems
Definition at line 880 of file grphbase.c. References BLOCKED, GRAPH::edges, GRAPH::esize, FARAWAY, graph_edge_add(), graph_knot_add(), graph_knot_chg(), graph_resize(), Is_term, GRAPH::knots, GRAPH::ksize, GRAPH::norgmodeledges, GRAPH::norgmodelknots, GRAPH::prize, GRAPH::source, STP_MAX_NODE_WEIGHT, STP_PRIZE_COLLECTING, GRAPH::stp_type, GRAPH::term, and GRAPH::terms. Referenced by graph_load(), and graph_MwcsToSap().
alters the graph for prize collecting problems
Definition at line 726 of file grphbase.c. References GRAPH::edges, GRAPH::esize, FARAWAY, graph_edge_add(), graph_knot_add(), graph_knot_chg(), graph_resize(), Is_term, GRAPH::knots, GRAPH::ksize, GRAPH::norgmodeledges, GRAPH::norgmodelknots, GRAPH::prize, GRAPH::source, STP_MAX_NODE_WEIGHT, STP_PRIZE_COLLECTING, GRAPH::stp_type, GRAPH::term, and GRAPH::terms. Referenced by graph_load(), and graph_maxweight_transform().
enlarge the graph
Definition at line 186 of file grphbase.c. References GRAPH::cost, GRAPH::edges, GRAPH::esize, GRAPH::grad, GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, GRAPH::knots, GRAPH::ksize, GRAPH::layers, GRAPH::locals, GRAPH::mark, GRAPH::oeat, GRAPH::outbeg, GRAPH::source, GRAPH::tail, and GRAPH::term. Referenced by graph_PcSapCopy(), graph_PcToSap(), graph_prize_transform(), and graph_rootprize_transform().
alters the graph for rooted prize collecting problems
Definition at line 955 of file grphbase.c. References GRAPH::edges, GRAPH::esize, FARAWAY, graph_edge_add(), graph_knot_add(), graph_knot_chg(), graph_resize(), Is_term, GRAPH::knots, GRAPH::ksize, GRAPH::norgmodeledges, GRAPH::norgmodelknots, GRAPH::prize, GRAPH::source, STP_ROOTED_PRIZE_COLLECTING, GRAPH::stp_type, GRAPH::term, and GRAPH::terms. Referenced by graph_load().
Definition at line 1318 of file grphbase.c. References GRAPH::cost, EAT_FREE, GRAPH::edges, GRAPH::grad, GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, GRAPH::knots, GRAPH::oeat, GRAPH::outbeg, GRAPH::tail, and GRAPH::term.
verifies whether a given primal solution is feasible
Definition at line 2639 of file grphbase.c. References CONNECT, EAT_LAST, FALSE, GRAPH::head, Is_term, GRAPH::knots, GRAPH::oeat, GRAPH::outbeg, GRAPH::source, GRAPH::term, GRAPH::terms, and TRUE. Referenced by SCIP_DECL_HEUREXEC(), and SCIPheurPrunePCSteinerTree().
traverse the graph
Definition at line 2510 of file grphbase.c. References EAT_LAST, GRAPH::head, GRAPH::mark, GRAPH::oeat, GRAPH::outbeg, and TRUE. Referenced by graph_valid(), and level0().
reinsert all hidden edges
Definition at line 2058 of file grphbase.c. References EAT_HIDE, GRAPH::edges, GRAPH::grad, GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, GRAPH::oeat, GRAPH::outbeg, and GRAPH::tail.
is the graph valid?
Definition at line 2532 of file grphbase.c. References EAT_FREE, EAT_LAST, GRAPH::edges, FALSE, GRAPH::grad, graph_trail(), GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, Is_term, GRAPH::knots, GRAPH::layers, GRAPH::locals, GRAPH::mark, GRAPH::oeat, GRAPH::outbeg, GRAPH::source, STP_MAX_NODE_WEIGHT, STP_PRIZE_COLLECTING, GRAPH::stp_type, GRAPH::tail, GRAPH::term, GRAPH::terms, and TRUE. Referenced by bd3_reduction(), degree_test(), degree_test_sap(), graph_copy(), graph_load(), graph_pack(), graph_save(), hcrbound_reduce(), hcrcbound_reduce(), hopbound_reduce(), ledge_reduction(), nvsl_reduction(), pcgraphtrans(), reduce(), SCIP_DECL_HEUREXEC(), SCIPheurImproveSteinerTree(), and sd_reduction().
Definition at line 2706 of file grphbase.c. References BLOCKED, EAT_LAST, FALSE, GRAPH::head, Is_term, GRAPH::knots, GRAPH::oeat, GRAPH::outbeg, GRAPH::source, GRAPH::term, GRAPH::terms, and TRUE.
mark terminals and switch terminal property to original terminals
Definition at line 2104 of file grphbase.c. References FALSE, GRAPH::grad, graph_knot_chg(), Is_pterm, Is_term, GRAPH::knots, GRAPH::mark, GRAPH::source, STP_ROOTED_PRIZE_COLLECTING, GRAPH::stp_type, GRAPH::term, and TRUE. Referenced by bound_reduce(), da_reduce(), daPc_reduce(), reduceMwcs(), and reducePc().
unmark terminals and switch terminal property to transformed terminals
Definition at line 2142 of file grphbase.c. References GRAPH::ancestors, GRAPH::cost, EAT_FREE, Edge_anti, GRAPH::edges, FALSE, GRAPH::fixedges, GRAPH::flags, GRAPH::grad, graph_edge_add(), graph_free(), graph_init(), graph_knot_add(), graph_knot_chg(), graph_valid(), GRAPH::grid_coordinates, GRAPH::grid_dim, GRAPH::grid_ncoords, GRAPH::head, GRAPH::hoplimit, GRAPH::ieat, Is_pterm, Is_term, GRAPH::knots, GRAPH::layers, GRAPH::mark, GRAPH::maxdeg, GRAPH::norgmodeledges, GRAPH::norgmodelknots, GRAPH::oeat, GRAPH::orgedges, GRAPH::orghead, GRAPH::orgknots, GRAPH::orgtail, SCIPintListNodeAppendCopy(), SCIPintListNodeFree(), GRAPH::source, GRAPH::stp_type, GRAPH::tail, GRAPH::term, GRAPH::terms, and UNKNOWN. Referenced by bound_reduce(), da_reduce(), daPc_reduce(), reduceMwcs(), and reducePc().
subtract a given sum from the prize of a terminal
Definition at line 1637 of file grphbase.c. References GRAPH::cost, EAT_LAST, GRAPH::head, GRAPH::ieat, GRAPH::inpbeg, Is_pterm, GRAPH::mark, GRAPH::oeat, GRAPH::outbeg, GRAPH::prize, GRAPH::source, STP_MAX_NODE_WEIGHT, STP_ROOTED_PRIZE_COLLECTING, GRAPH::stp_type, GRAPH::tail, and GRAPH::term. Referenced by graph_knot_contractpc(). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||