Topic
  • 6 replies
  • Latest Post - ‏2015-01-15T01:21:19Z by max__x
heidizh
heidizh
16 Posts

Pinned topic How to express it using CPLEX?

‏2013-09-24T07:54:30Z |

S is a set of nodes. I want to express that i belongs to  S while j does not belong to it. How to express it using CPELX?

 

Let me explain it more explicitly. V is a set of nodes. S represents an arbitrary set of nodes, and S belongs to V. How to express it when i is in S and j is not S but in V?

 

Updated on 2013-09-24T08:31:12Z at 2013-09-24T08:31:12Z by heidizh
  • AlexFleischer
    AlexFleischer
    1916 Posts
    ACCEPTED ANSWER

    Re: How to express it using CPLEX?

    ‏2013-09-24T08:05:48Z  

    Hi,

     

    let me give you an example of in and not in:

     

    {string} nodes={"A","B"};

    string s1="A";
    string s2="C";

    assert s1 in nodes;
    assert s2 not in nodes;

     

    regards

  • AlexFleischer
    AlexFleischer
    1916 Posts

    Re: How to express it using CPLEX?

    ‏2013-09-24T08:05:48Z  

    Hi,

     

    let me give you an example of in and not in:

     

    {string} nodes={"A","B"};

    string s1="A";
    string s2="C";

    assert s1 in nodes;
    assert s2 not in nodes;

     

    regards

  • heidizh
    heidizh
    16 Posts

    Re: How to express it using CPLEX?

    ‏2013-09-24T08:12:20Z  

    Hi,

     

    let me give you an example of in and not in:

     

    {string} nodes={"A","B"};

    string s1="A";
    string s2="C";

    assert s1 in nodes;
    assert s2 not in nodes;

     

    regards

    Thank you very much! Actually, I  want to express a constraint somehow different from the example you give. Please check it in the attachments. Thank you.

  • heidizh
    heidizh
    16 Posts

    Re: How to express it using CPLEX?

    ‏2013-09-24T08:20:18Z  

    Hi,

     

    let me give you an example of in and not in:

     

    {string} nodes={"A","B"};

    string s1="A";
    string s2="C";

    assert s1 in nodes;
    assert s2 not in nodes;

     

    regards

    Let me explain it more explicitly. V is a set of nodes. S represents an arbitrary set of nodes, and S belongs to V. How to express it when i is in S and j is not S but in V?

  • AlexFleischer
    AlexFleischer
    1916 Posts

    Re: How to express it using CPLEX?

    ‏2013-09-24T08:55:36Z  
    • heidizh
    • ‏2013-09-24T08:20:18Z

    Let me explain it more explicitly. V is a set of nodes. S represents an arbitrary set of nodes, and S belongs to V. How to express it when i is in S and j is not S but in V?

    forall(i in S,j in (S diff V)) ?

    but if what you want to express is for all S subset of V then this is something else

    regards

  • heidizh
    heidizh
    16 Posts

    Re: How to express it using CPLEX?

    ‏2013-09-24T08:59:27Z  

    forall(i in S,j in (S diff V)) ?

    but if what you want to express is for all S subset of V then this is something else

    regards

    Thank you, Alex. 

    You guess it. What i want to express is for all S subset of V,  can you help me express it?

  • max__x
    max__x
    5 Posts

    Re: How to express it using CPLEX?

    ‏2015-01-15T01:21:19Z  

    Hello, Heidizh

    Have you solve the problem you got?

    since  I am facing the same problem as you, if you solved it, could you tell me how to do it.

    I will very appreciate it!