Topic
  • 6 replies
  • Latest Post - ‏2014-05-22T17:30:29Z by MaryFenelon
jite
jite
3 Posts

Pinned topic writing decision variables in a file

‏2014-05-14T18:48:48Z |

how to write only decision variables value after optimization in a command prompt CPLEX. 

  • AlexFleischer
    AlexFleischer
    77 Posts

    Re: writing decision variables in a file

    ‏2014-05-19T08:41:07Z  

    Hi

    CPLEX> w solution2.sol
    Incumbent solution written to file 'solution2.sol'.

     

    for details, doc CPLEX > Parameters of CPLEX > List of CPLEX parameters

    CPLEX > Parameters of CPLEX > List of CPLEX parameters

    regards

  • jite
    jite
    3 Posts

    Re: writing decision variables in a file

    ‏2014-05-20T07:34:02Z  

    Hi

    CPLEX> w solution2.sol
    Incumbent solution written to file 'solution2.sol'.

     

    for details, doc CPLEX > Parameters of CPLEX > List of CPLEX parameters

    CPLEX > Parameters of CPLEX > List of CPLEX parameters

    regards

    Hi, 

    this step will write constraint's slag value too, this makes large size solution file. number of variables in my problem is around 6 lakhs and number of constraints is more than 1 crore.   

    thats why I just want variables value only in that file, so how is that possible??

     

  • AlexFleischer
    AlexFleischer
    77 Posts

    Re: writing decision variables in a file

    ‏2014-05-20T07:59:35Z  
    • jite
    • ‏2014-05-20T07:34:02Z

    Hi, 

    this step will write constraint's slag value too, this makes large size solution file. number of variables in my problem is around 6 lakhs and number of constraints is more than 1 crore.   

    thats why I just want variables value only in that file, so how is that possible??

     

    Hi,

    in doc CPLEX > Getting Started with CPLEX > Tutorials > Solving an LP with CPLEX

    you will see

    CPLEX> display solution variables x1-x3

    Variable Name Solution Value

    x1 40.000000

    x2 17.500000

    x3 42.500000

    regards

  • jite
    jite
    3 Posts

    Re: writing decision variables in a file

    ‏2014-05-20T08:08:22Z  

    Hi,

    in doc CPLEX > Getting Started with CPLEX > Tutorials > Solving an LP with CPLEX

    you will see

    CPLEX> display solution variables x1-x3

    Variable Name Solution Value

    x1 40.000000

    x2 17.500000

    x3 42.500000

    regards

    this is for display only, can i write these in a file??

  • AlexFleischer
    AlexFleischer
    77 Posts

    Re: writing decision variables in a file

    ‏2014-05-20T09:14:49Z  
    • jite
    • ‏2014-05-20T08:08:22Z

    this is for display only, can i write these in a file??

    Ok then why do not you try .bas or .mst format ?

    regards

  • MaryFenelon
    MaryFenelon
    14 Posts

    Re: writing decision variables in a file

    ‏2014-05-22T17:30:29Z  
    • jite
    • ‏2014-05-20T08:08:22Z

    this is for display only, can i write these in a file??

    If you "set output writelevel" you can omit the zero values in the .sol or .mst file.