help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] Constraints Problem


From: Simone Atzeni
Subject: [Help-glpk] Constraints Problem
Date: Thu, 4 Dec 2008 00:33:24 +0300

Hi,I have a problem with GLPK.

I had written a program like this:




lpx_set_prob_name(lp,"SAPP");

lpx_set_obj_dir(lp,LPX_MIN);




lpx_add_rows(lp,1);

lpx_add_cols(lp,4);






lpx_set_col_kind(lp,1,LPX_IV);

lpx_set_col_name(lp,1,"V1");

lpx_set_col_bnds(lp,1,LPX_DB,0.0,1.0);




lpx_set_col_kind(lp,2,LPX_IV);

lpx_set_col_name(lp,2,"V2");

lpx_set_col_bnds(lp,2,LPX_DB,0.0,1.0);




lpx_set_col_kind(lp,3,LPX_IV);

lpx_set_col_name(lp,3,"V3");

lpx_set_col_bnds(lp,3,LPX_DB,0.0,1.0);




lpx_set_col_kind(lp,4,LPX_IV);

lpx_set_col_name(lp,4,"V4");

lpx_set_col_bnds(lp,4,LPX_DB,0.0,1.0);












lpx_set_row_name(lp,1,"VERTEXFLOW");

lpx_set_row_bnds(lp,1,LPX_FX,0.0,0.0);




ia[1] = 1, ja[1] = 1, ar[1] = 1.0;

ia[2] = 1, ja[2] = 2, ar[2] = 1.0;

ia[3] = 1, ja[3] = 3, ar[3] = -1.0;

ia[4] = 1, ja[4] = 4, ar[4] = -1.0;




lpx_load_matrix(lp,1,ia,ja,ar);






Then I get the command:




...




lpx_print_prob(lp,"vincoli.txt");




...




The result is:




...




Row 1: VERTEXFLOW = 0

1 V1


1 V2





...






but there are not V3 and V4.




What is the problem??




The program that I show in this mail is only an example, but the real program 
is very big. It has about 1500 variables and 300 constraints, so I have the 
same problem about several constraints.




Can you help me?

Sorry for my bad english :-D

Thanks.




Simone Atzeni
















Hi,
I have a problem with GLPK.
I had written a program like this:

lpx_set_prob_name(lp,"SAPP");
lpx_set_obj_dir(lp,LPX_MIN);

lpx_add_rows(lp,1);

lpx_add_cols(lp,4);


lpx_set_col_kind(lp,1,LPX_IV);
lpx_set_col_name(lp,1,"V1");
lpx_set_col_bnds(lp,1,LPX_DB,0.0,1.0);

lpx_set_col_kind(lp,2,LPX_IV);
lpx_set_col_name(lp,2,"V2");
lpx_set_col_bnds(lp,2,LPX_DB,0.0,1.0);

lpx_set_col_kind(lp,3,LPX_IV);
lpx_set_col_name(lp,3,"V3");
lpx_set_col_bnds(lp,3,LPX_DB,0.0,1.0);

lpx_set_col_kind(lp,4,LPX_IV);
lpx_set_col_name(lp,4,"V4");
lpx_set_col_bnds(lp,4,LPX_DB,0.0,1.0);

lpx_set_row_name(lp,1,"VERTEXFLOW");
lpx_set_row_bnds(lp,1,LPX_FX,0.0,0.0);

ia[1] = 1, ja[1] = 1, ar[1] = 1.0;
ia[2] = 1, ja[2] = 2, ar[2] = 1.0;
ia[3] = 1, ja[3] = 3, ar[3] = -1.0;
ia[4] = 1, ja[4] = 4, ar[4] = -1.0;

lpx_load_matrix(lp,1,ia,ja,ar);

Then I get the command:

...

lpx_print_prob(lp,"vincoli.txt");

...

The result is:

...

Row 1: VERTEXFLOW = 0
1 V1
1 V2

...

but there are not V3 and V4.

What is the problem??

The program that I show in this mail is only an example, but the real program is very big. It has about 1500 variables and 300 constraints, so I have the same problem about several constraints.

Can you help me?
Sorry for my bad english :-D
Thanks.

Simone Atzeni





reply via email to

[Prev in Thread] Current Thread [Next in Thread]