pwLPFiles              package:PathWave              R Documentation

_P_a_t_h_W_a_v_e _i_n_p_u_t _f_i_l_e _g_e_n_e_r_a_t_o_r _f_o_r _L_P _s_o_l_v_e_r

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

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.

_D_e_t_a_i_l_s:

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

_s_t_r_a_t_e_g_y 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.

_a_d_d_T_r_i_a_n_g_l_e_I_n_e_q_u_a_l_i_t_i_e_s 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.

_a_d_d_C_l_i_q_u_e_C_o_n_s_t_r_a_i_n_t_s 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.

_a_d_d_S_y_m_m_e_t_r_y_B_r_e_a_k_i_n_g_C_o_n_s_t_r_a_i_n_t_s Choice only valid if strategy "manually"
     is chosen. Searches for topological conformations.

_a_d_d_S_t_a_r_I_n_e_q_u_a_l_i_t_i_e_s Choice only valid if strategy "manually" is chosen.
     Builds inequalities with lower limits for hub like structures in
     the graph.

_a_d_d_5_C_y_c_l_e_C_o_n_s_t_r_a_i_n_t_s Choice only valid if strategy "manually" is
     chosen. Builds inequalities with lower limits for circles with 5
     members in the graph.

_u_s_e_D_u_m_m_y_N_o_d_e_s Choice only valid if strategy "manually" is chosen. Dummy
     nodes are introduced, filling up the adjacency matrix. Strangely,
     this can speed up CPLEX.

_a_d_d_N_e_i_g_h_b_o_u_r_S_t_a_r_C_o_n_s_t_r_a_i_n_t_s 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.

_V_a_l_u_e:

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

_A_u_t_h_o_r(_s):

     Gunnar Schramm, Stefan Wiesberg

_S_e_e _A_l_s_o:

     See Also as 'pwAdjMatrices','pwOptGrids'

_E_x_a_m_p_l_e_s:

     #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)

