Operations Research Asked by Amedeo on January 18, 2021

In an undirected graph, I’m trying to model a constraint that forcing the optimizer to set an edge $(u,v)$ between two nodes to only exist (= $1$) if the two nodes have been selected to be $1$. The three decision variables can be something like that:

$z(u,v) geq y_u x_v$ , $quad x,y,z in {0,1}$

and to linearize the multiplication here, I’m introducing a new decision variable $r=xy$ and these constraints has been added:

$z(u,v) geq r(u,v)$

$r(u,v) leq y_u$

$r(u,v) leq x_v$

$r(u,v) geq y_u + x_v -1$

Keeping in mind that this is for undirected graph where $r(u,v)$ is different from $r(v,u)$. How can I model this in Python using **Pulp** and **NetworkX** ?

1 Asked on January 5, 2022

1 Asked on January 1, 2022 by ehsank

1 Asked on January 1, 2022

big m chance constraints mixed integer programming stochastic programming

1 Asked on December 20, 2021 by cesar-canassa

1 Asked on December 18, 2021 by neverletgo

2 Asked on December 9, 2021 by farouk-hammami

combinatorial optimization cplex linearization optimization quadratic programming

3 Asked on November 24, 2021

1 Asked on November 17, 2021

15 Asked on August 19, 2021

3 Asked on August 19, 2021

4 Asked on August 19, 2021 by marco-lbbecke

2 Asked on August 19, 2021 by matheus-digenes-andrade

2 Asked on August 19, 2021

2 Asked on August 19, 2021 by user3831

3 Asked on August 19, 2021 by josh-allen

2 Asked on August 19, 2021 by ehsan

1 Asked on August 19, 2021

Get help from others!

Recent Answers

- Jon Church on Why fry rice before boiling?
- Joshua Engel on Why fry rice before boiling?
- Lex on Does Google Analytics track 404 page responses as valid page views?
- haakon.io on Why fry rice before boiling?
- Peter Machado on Why fry rice before boiling?

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP