Andrew Makhorin wrote:
>> - Do you want me to create a small test case to demonstrate the issue?
> 
> Yes, please do that and post it to me. I will reply to your questions
> a bit later, maybe tomorrow.
> 
> Andrew Makhorin
> 
> 

Andrew,

My apologies.  It is not add_rows, but del_cols that is an issue.  I 
wrote the previous email from memory, which was incorrect.

I am attaching a test case.  If we remove the first column of p0033, 
then re-solving fails.  However, if you remove the second column, it 
succeeds.  You can check this by changing the index to be removed.

Presumably the first column is basic in the original solution and the 
second column is non-basic.

My question is this:
- If a basic column is removed, what behavior do you expect from GLPK? 
Should it adjust the basis and resolve?  Resolve starting from the 
beginning (a new basis)?  Fail?

Thanks,
Brady

-- 
Brady Hunsaker
Assistant Professor
Industrial Engineering
University of Pittsburgh
http://www.engr.pitt.edu/hunsaker/
/*
 * simple_glpk.c
 *
 *   A file demonstrating the GLPK API.
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include "glpk.h"

int 
main( void )
{
  /* Pointer to the lp object */
  LPX *lp;
  int ret;  /* return code */
  char *filename = "p0033.mps";
  int columns[2];

  /* Read in an instance from an MPS file */
  lp = lpx_read_mps( filename );
  /* lp = lpx_read_freemps( filename ); */

  /* Check that we read it correctly */
  if (lp == NULL)
    {
      printf("Error reading file %s\n", filename);
      exit(1);
    }

  /* Solve the (relaxation of the) problem */
  ret = lpx_simplex(lp);

  /* Check the solution */
  if ( ret == LPX_E_OK && lpx_get_status(lp) == LPX_OPT )
    { 
      printf("Found optimal solution!\n"); 
      printf("Objective value is %lf.\n", lpx_get_obj_val(lp) );
    }

  /***************************/
  /* Remove the first column */
  /* This will fail, but if you change the index to a 2, it will succeed */
  columns[1]=1;
  lpx_del_cols( lp, 1, columns );
  
  /* Re-solve */
  ret = lpx_simplex(lp);

  /* Check the solution */
  if ( ret == LPX_E_OK && lpx_get_status(lp) == LPX_OPT )
    { 
      printf("Resolved and found optimal solution!\n"); 
      printf("Objective value is %lf.\n", lpx_get_obj_val(lp) );
    }
  else
    {
      printf("Something went wrong during resolve.\n");
    }

  return 0;
}
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to