pwLPFiles {PathWave}R Documentation

PathWave input file generator for LP solver

Description

Generates files of inequalities to be solved by a standard LP solver. Output files are in CPLEX format.

Usage

pwLPFiles(adjMatrix, strategy = "automatic", addTriangleInequalities = TRUE, addCliqueConstraints = TRUE, addSymmetryBreakingConstraints = TRUE, addStarInequalities = TRUE, add5CycleConstraints = TRUE, useDummyNodes = TRUE, addNeighbourStarConstraints = FALSE)

Arguments

adjMatrix List of adjacency matrices as returned by function pwAdjMatrices().
strategy File generating strategy. Choices are "automatic" (default),"manually","largesystem" and "basicsystem". See details.
addTriangleInequalities Boolean variable. Can be changed if strategy "manually" is chosen (default TRUE). See details.
addCliqueConstraints Boolean variable. Can be changed if strategy "manually" is chosen (default TRUE). See details.
addSymmetryBreakingConstraints Boolean variable. Can be changed if strategy "manually" is chosen (default TRUE). See details.
addStarInequalities Boolean variable. Can be changed if strategy "manually" is chosen (default TRUE). See details.
add5CycleConstraints Boolean variable. Can be changed if strategy "manually" is chosen (default TRUE). See details.
useDummyNodes Boolean variable. Can be changed if strategy "manually" is chosen (default TRUE). See details.
addNeighbourStarConstraints Boolean variable. Can be changed if strategy "manually" is chosen (default FALSE). See details.

Details

The function searches for constraining symmetries in the graph to facilitate the optimisation problem.

strategy
The file generating strategy can be adapted to the size of the adjacency matrices. Choice "automatic" does this automatically, "largesystem" could be used for larger adjacency matrices. Strategy "basicsystem" derives only the simplest basic constraints that are necessary to solve the optimisation problem. With strategy "manually" the user can decide what inequalities should be considered for the optimisation problem.
addTriangleInequalities
Choice only valid if strategy "manually" is chosen. Searches for triangles in the graph. The sum of the manhattan distances for the three neighbouring nodes must be at least 4.
addCliqueConstraints
Choice only valid if strategy "manually" is chosen. Searches for cliques in the graph. A lower limit for the sum of the member distances can be set.
addSymmetryBreakingConstraints
Choice only valid if strategy "manually" is chosen. Searches for topological conformations.
addStarInequalities
Choice only valid if strategy "manually" is chosen. Builds inequalities with lower limits for hub like structures in the graph.
add5CycleConstraints
Choice only valid if strategy "manually" is chosen. Builds inequalities with lower limits for circles with 5 members in the graph.
useDummyNodes
Choice only valid if strategy "manually" is chosen. Dummy nodes are introduced, filling up the adjacency matrix. Strangely, this can speed up CPLEX.
addNeighbourStarConstraints
Choice only valid if strategy "manually" is chosen. Searches for special structures from which inequalities can be built.
The output files can be read into CPLEX or other LP solver. They should also be usable with GNUs GLPK.

Value

For each input pathway a file -pathwayID.lp- is written out into the working directory.

Author(s)

Gunnar Schramm, Stefan Wiesberg

See Also

See Also as pwAdjMatrices,pwOptGrids

Examples

#build a simple adjacency matrix
library(e1071)
#define number of nodes and generate random adjacency matrix
nNodes=5
M=dist.matrix=matrix(sample(c(0,1),nNodes^2,replace=TRUE),nrow=nNodes,ncol=nNodes)
rownames(M)=colnames(M)=paste("R",1:nNodes,sep="")

#distances
dist.matrix[dist.matrix==0]=Inf
dist.matrix=allShortestPaths(dist.matrix)$length 

#avoid infinity and NAs in this test case
dist.matrix[is.na(dist.matrix)]=0
dist.matrix[dist.matrix==Inf]=0

#set iMax
iMax=max(dist.matrix)

#build test list
test.list=list()
test.list[["testGraph"]]=list(nNodes=nNodes, iMax=iMax, M=M)

#a file "testGraph.lp" should be printed
pwLPFiles(test.list)

[Package PathWave version 1.0 Index]