Scippy

SCIP

Solving Constraint Integer Programs

graph_grid.c File Reference

Detailed Description

includes graph grid methods for Steiner problems

Author
Daniel Rehfeldt

Graph grid methods for Steiner problems !!!OBSTACLE GRID METHODS ARE DEPRECATED!!!

Definition in file graph_grid.c.

#include "graph.h"
#include "portab.h"

Go to the source code of this file.

Functions

static int getNodeNumber (int grid_dim, int shiftcoord, int *ncoords, int *currcoord)
 
static void compEdgesObst (int coord, int grid_dim, int nobstacles, int *ncoords, int *currcoord, int *edgecosts, int *gridedgecount, int **coords, int **gridedges, int **obst_coords, char *inobstacle)
 
static void compEdges (int coord, int grid_dim, int *ncoords, int *currcoord, int *edgecosts, int *gridedgecount, int **coords, int **gridedges)
 
SCIP_RETCODE graph_obstgrid_create (SCIP *scip, GRAPH **gridgraph, int **coords, int **obst_coords, int nterms, int grid_dim, int nobstacles, int scale_order)
 
SCIP_RETCODE graph_grid_create (SCIP *scip, GRAPH **gridgraph, int **coords, int nterms, int grid_dim, int scale_order)
 
SCIP_RETCODE graph_grid_coordinates (SCIP *scip, int **coords, int **nodecoords, int *ncoords, int node, int grid_dim)
 

Function Documentation

◆ getNodeNumber()

static int getNodeNumber ( int  grid_dim,
int  shiftcoord,
int *  ncoords,
int *  currcoord 
)
static

used by graph_grid_create

Definition at line 37 of file graph_grid.c.

References number.

Referenced by compEdges(), compEdgesObst(), graph_grid_create(), and graph_obstgrid_create().

◆ compEdgesObst()

static void compEdgesObst ( int  coord,
int  grid_dim,
int  nobstacles,
int *  ncoords,
int *  currcoord,
int *  edgecosts,
int *  gridedgecount,
int **  coords,
int **  gridedges,
int **  obst_coords,
char *  inobstacle 
)
static

used by graph_obstgrid_create

Definition at line 67 of file graph_grid.c.

References FALSE, getNodeNumber(), TRUE, x, and y.

Referenced by graph_obstgrid_create().

◆ compEdges()

static void compEdges ( int  coord,
int  grid_dim,
int *  ncoords,
int *  currcoord,
int *  edgecosts,
int *  gridedgecount,
int **  coords,
int **  gridedges 
)
static

used by graph_grid_create

Definition at line 132 of file graph_grid.c.

References getNodeNumber().

Referenced by graph_grid_create().

◆ graph_obstgrid_create()

SCIP_RETCODE graph_obstgrid_create ( SCIP scip,
GRAPH **  gridgraph,
int **  coords,
int **  obst_coords,
int  nterms,
int  grid_dim,
int  nobstacles,
int  scale_order 
)

creates a graph out of a given grid

Parameters
scipSCIP data structure
gridgraphthe (obstacle) grid graph to be constructed
coordscoordinates of all points
obst_coordscoordinates of obstacles
ntermsnumber of terminals
grid_dimdimension of the problem
nobstaclesnumber of obstacles
scale_orderscale factor

Definition at line 175 of file graph_grid.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, nnodes, nterms, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPallocMemoryArray, SCIPfreeBufferArray, SCIPsortInt(), GRAPH::source, STP_OARSMT, GRAPH::stp_type, and TRUE.

Referenced by graph_load().

◆ graph_grid_create()

SCIP_RETCODE graph_grid_create ( SCIP scip,
GRAPH **  gridgraph,
int **  coords,
int  nterms,
int  grid_dim,
int  scale_order 
)

creates a graph out of a given grid

Parameters
scipSCIP data structure
gridgraphthe grid graph to be constructed
coordscoordinates
ntermsnumber of terminals
grid_dimproblem dimension
scale_orderscale order

Definition at line 338 of file graph_grid.c.

References compEdges(), getNodeNumber(), graph_edge_add(), graph_init(), graph_knot_add(), graph_knot_chg(), GRAPH::grid_coordinates, GRAPH::grid_dim, GRAPH::grid_ncoords, nnodes, nterms, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPallocMemoryArray, SCIPfreeBufferArray, SCIPsortInt(), STP_RSMT, and GRAPH::stp_type.

Referenced by graph_load().

◆ graph_grid_coordinates()

SCIP_RETCODE graph_grid_coordinates ( SCIP scip,
int **  coords,
int **  nodecoords,
int *  ncoords,
int  node,
int  grid_dim 
)

computes coordinates of node 'node'

Parameters
scipSCIP data structure
coordscoordinates
nodecoordscoordinates of the node (to be computed)
ncoordsarray with number of coordinate
nodethe node
grid_dimproblem dimension

Definition at line 486 of file graph_grid.c.

References NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocMemoryArray.

Referenced by SCIPprobdataWriteSolution().