SlideShare a Scribd company logo
1 of 1
Download to read offline
We are given an undirected graph G = (N, E), where N is the set of nodes and E is the set of
edges. Suppose that we can color a node in the graph G so that the number of edges connected to
two nodes with different colors is maximized. Formulate this problem as an integer linear
program.
Solution
Let node i have 3 indicator variables ri, yi, bi
ri = 1 if the node is red, 0 otherwise.
yi = 1 if the node is yellow, 0 otherwise.
bi= 1 if the node is blue, 0 otherwise.
Then, let edge e ij be the edge from i to j where there is an edge in the above diagram.
Thus, we have e12, e13, e15, e24, e23, e27, e35, e34, e36, e45, e46, e47, e 56, e57, and e67.
We will let this have the value 1 if nodes i and j have different color and otherwise have value 0.
max e12 + e13 + e15 + e24 + e23+ e27 + e35 + e34 + e36 + e45 + e46 + e47 + e56 + e57 + e67
subject to
ri + rj + eij <= 2.
yi + yj + eij <= 2.
yi + yj + eij <= 2.
for ij {12, 13, 15, 24, 23, 27, 35, 34, 36, 45, 46, 47, 56, 57, 67}
Note that these inequalities work. If the colors are the same, for that color, they add to 2, so the
edge has value 0, and they sum to 2 is less than or equal to 2. For the other colors, they add to 0,
+ 0 for the edge is 0 is less than or equal to 2.
If the colors are different, then the sum over each of the 3 colors will be 1 in 2 cases and 0 in the
other, so the edge will have value 1, and the sum will be 1 in 1 case and 2 in the other 2.
(While the edge could have a smaller value, this would not be the solution at the maximum, so
the formulation works.)
At each node, we must have one of ri, yi, and b i equal to 1 and the others equal to 0.
Have them sum to 1 so there is a color at each node ri + yi + bi = 1 i = 1, 2, 3, 4, 5, 6, 7
All variables are greater than or equal to 0.
All variables in this problem are integers.

More Related Content

Similar to We are given an undirected graph G = (N, E), where N is the set of no.pdf

A linear algorithm for the grundy number of a tree
A linear algorithm for the grundy number of a treeA linear algorithm for the grundy number of a tree
A linear algorithm for the grundy number of a treeijcsit
 
Linear equations
Linear equationsLinear equations
Linear equationscriss ch
 
Linear equations
Linear equationsLinear equations
Linear equationscriss ch
 
On sum edge coloring of regular, bipartite and split graphs
On sum edge coloring of regular,  bipartite and split graphsOn sum edge coloring of regular,  bipartite and split graphs
On sum edge coloring of regular, bipartite and split graphs政謙 陳
 
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphs
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple GraphsGreedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphs
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphsinventionjournals
 
Liner equation two variables
Liner equation two variablesLiner equation two variables
Liner equation two variablesSiddu Lingesh
 
List Coloring.pptx
List Coloring.pptxList Coloring.pptx
List Coloring.pptxamitkrinbox
 
Lesson 1 imaginary and complex numbers p1 8
Lesson 1 imaginary and complex numbers p1 8Lesson 1 imaginary and complex numbers p1 8
Lesson 1 imaginary and complex numbers p1 8jenniech
 
GCSE-Surds.pptx
GCSE-Surds.pptxGCSE-Surds.pptx
GCSE-Surds.pptxBimboBbsax
 
LINEAR EQUATION IN TWO VARIABLES
LINEAR EQUATION IN TWO VARIABLESLINEAR EQUATION IN TWO VARIABLES
LINEAR EQUATION IN TWO VARIABLESDEV YADAV
 
Linear equations in two variables
Linear equations in two variablesLinear equations in two variables
Linear equations in two variablesEdrin Jay Morta
 
Resolver inecuaciones 2009.pdf
Resolver inecuaciones 2009.pdfResolver inecuaciones 2009.pdf
Resolver inecuaciones 2009.pdfedwinllantoy2
 
Math 7, Integers Notes.pptx
Math 7, Integers Notes.pptxMath 7, Integers Notes.pptx
Math 7, Integers Notes.pptxEmilyLawson28
 
Analytic Geometry Period 1
Analytic Geometry Period 1Analytic Geometry Period 1
Analytic Geometry Period 1ingroy
 

Similar to We are given an undirected graph G = (N, E), where N is the set of no.pdf (20)

A linear algorithm for the grundy number of a tree
A linear algorithm for the grundy number of a treeA linear algorithm for the grundy number of a tree
A linear algorithm for the grundy number of a tree
 
Linear equations
Linear equationsLinear equations
Linear equations
 
Linear equations
Linear equationsLinear equations
Linear equations
 
On sum edge coloring of regular, bipartite and split graphs
On sum edge coloring of regular,  bipartite and split graphsOn sum edge coloring of regular,  bipartite and split graphs
On sum edge coloring of regular, bipartite and split graphs
 
Lesson 2
Lesson 2Lesson 2
Lesson 2
 
Aieee aieee-maths-2009
Aieee aieee-maths-2009Aieee aieee-maths-2009
Aieee aieee-maths-2009
 
inequalities
 inequalities inequalities
inequalities
 
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphs
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple GraphsGreedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphs
Greedy Edge Colouring for Lower Bound of an Achromatic Index of Simple Graphs
 
Liner equation two variables
Liner equation two variablesLiner equation two variables
Liner equation two variables
 
List Coloring.pptx
List Coloring.pptxList Coloring.pptx
List Coloring.pptx
 
Lesson 1 imaginary and complex numbers p1 8
Lesson 1 imaginary and complex numbers p1 8Lesson 1 imaginary and complex numbers p1 8
Lesson 1 imaginary and complex numbers p1 8
 
GCSE-Surds.pptx
GCSE-Surds.pptxGCSE-Surds.pptx
GCSE-Surds.pptx
 
Marh algebra lesson
Marh algebra lessonMarh algebra lesson
Marh algebra lesson
 
LINEAR EQUATION IN TWO VARIABLES
LINEAR EQUATION IN TWO VARIABLESLINEAR EQUATION IN TWO VARIABLES
LINEAR EQUATION IN TWO VARIABLES
 
Linear equations in two variables
Linear equations in two variablesLinear equations in two variables
Linear equations in two variables
 
Lesson 3
Lesson 3Lesson 3
Lesson 3
 
Coding
CodingCoding
Coding
 
Resolver inecuaciones 2009.pdf
Resolver inecuaciones 2009.pdfResolver inecuaciones 2009.pdf
Resolver inecuaciones 2009.pdf
 
Math 7, Integers Notes.pptx
Math 7, Integers Notes.pptxMath 7, Integers Notes.pptx
Math 7, Integers Notes.pptx
 
Analytic Geometry Period 1
Analytic Geometry Period 1Analytic Geometry Period 1
Analytic Geometry Period 1
 

More from admaniimran

What is the difference to be found between surface waters and the.pdf
 What is the difference to be found between surface waters and the.pdf What is the difference to be found between surface waters and the.pdf
What is the difference to be found between surface waters and the.pdfadmaniimran
 
What is the area of the parallelogram (5,6) (-7,6) 5, 4 7, 4 Sol.pdf
 What is the area of the parallelogram (5,6) (-7,6) 5, 4 7, 4 Sol.pdf What is the area of the parallelogram (5,6) (-7,6) 5, 4 7, 4 Sol.pdf
What is the area of the parallelogram (5,6) (-7,6) 5, 4 7, 4 Sol.pdfadmaniimran
 
What is return on equity What is net profit margin What is total as.pdf
 What is return on equity What is net profit margin What is total as.pdf What is return on equity What is net profit margin What is total as.pdf
What is return on equity What is net profit margin What is total as.pdfadmaniimran
 
What is on a classified balance sheet What is on a classified b.pdf
 What is on a classified balance sheet What is on a classified b.pdf What is on a classified balance sheet What is on a classified b.pdf
What is on a classified balance sheet What is on a classified b.pdfadmaniimran
 
What is depreciation What is depreciation Solu.pdf
 What is depreciation  What is depreciation Solu.pdf What is depreciation  What is depreciation Solu.pdf
What is depreciation What is depreciation Solu.pdfadmaniimran
 
What industry controlled California politics in the late 1800s and .pdf
 What industry controlled California politics in the late 1800s and .pdf What industry controlled California politics in the late 1800s and .pdf
What industry controlled California politics in the late 1800s and .pdfadmaniimran
 
what functions were intergrates into the microfluidic chip projec.pdf
 what functions were intergrates into the microfluidic chip projec.pdf what functions were intergrates into the microfluidic chip projec.pdf
what functions were intergrates into the microfluidic chip projec.pdfadmaniimran
 
What does a Geothermal heating and cooling do (I appreciate it if yo.pdf
 What does a Geothermal heating and cooling do (I appreciate it if yo.pdf What does a Geothermal heating and cooling do (I appreciate it if yo.pdf
What does a Geothermal heating and cooling do (I appreciate it if yo.pdfadmaniimran
 
What does the acronym GIS stands for List any 4 (four) componentss.pdf
 What does the acronym GIS stands for  List any 4 (four) componentss.pdf What does the acronym GIS stands for  List any 4 (four) componentss.pdf
What does the acronym GIS stands for List any 4 (four) componentss.pdfadmaniimran
 
What distribution does the F distribution approach as the sample .pdf
 What distribution does the F distribution approach as the sample .pdf What distribution does the F distribution approach as the sample .pdf
What distribution does the F distribution approach as the sample .pdfadmaniimran
 
What communication skills do business value What communication.pdf
 What communication skills do business value What communication.pdf What communication skills do business value What communication.pdf
What communication skills do business value What communication.pdfadmaniimran
 
What assumptions are made about the population from which indepen.pdf
 What assumptions are made about the population from which indepen.pdf What assumptions are made about the population from which indepen.pdf
What assumptions are made about the population from which indepen.pdfadmaniimran
 
What are the various sources of conflict and politics that have p.pdf
 What are the various sources of conflict and politics that have p.pdf What are the various sources of conflict and politics that have p.pdf
What are the various sources of conflict and politics that have p.pdfadmaniimran
 
What are the two new civilian codes added to the modernized satellite.pdf
 What are the two new civilian codes added to the modernized satellite.pdf What are the two new civilian codes added to the modernized satellite.pdf
What are the two new civilian codes added to the modernized satellite.pdfadmaniimran
 
What are the main techniques of capital budgeting Can you briefl.pdf
 What are the main techniques of capital budgeting Can you briefl.pdf What are the main techniques of capital budgeting Can you briefl.pdf
What are the main techniques of capital budgeting Can you briefl.pdfadmaniimran
 
What are the different ways of loading a code into an AYR chipSo.pdf
 What are the different ways of loading a code into an AYR chipSo.pdf What are the different ways of loading a code into an AYR chipSo.pdf
What are the different ways of loading a code into an AYR chipSo.pdfadmaniimran
 
What are the differences between PSK and DPSKSolutionThe fol.pdf
 What are the differences between PSK and DPSKSolutionThe fol.pdf What are the differences between PSK and DPSKSolutionThe fol.pdf
What are the differences between PSK and DPSKSolutionThe fol.pdfadmaniimran
 
What are some factors used to determine whether an individual is an e.pdf
 What are some factors used to determine whether an individual is an e.pdf What are some factors used to determine whether an individual is an e.pdf
What are some factors used to determine whether an individual is an e.pdfadmaniimran
 
What are the current asset financing strategies that firms adopt Fi.pdf
 What are the current asset financing strategies that firms adopt  Fi.pdf What are the current asset financing strategies that firms adopt  Fi.pdf
What are the current asset financing strategies that firms adopt Fi.pdfadmaniimran
 
What are the areas in Transportation Engineering, where Civil Eng.pdf
 What are the areas in Transportation Engineering, where Civil Eng.pdf What are the areas in Transportation Engineering, where Civil Eng.pdf
What are the areas in Transportation Engineering, where Civil Eng.pdfadmaniimran
 

More from admaniimran (20)

What is the difference to be found between surface waters and the.pdf
 What is the difference to be found between surface waters and the.pdf What is the difference to be found between surface waters and the.pdf
What is the difference to be found between surface waters and the.pdf
 
What is the area of the parallelogram (5,6) (-7,6) 5, 4 7, 4 Sol.pdf
 What is the area of the parallelogram (5,6) (-7,6) 5, 4 7, 4 Sol.pdf What is the area of the parallelogram (5,6) (-7,6) 5, 4 7, 4 Sol.pdf
What is the area of the parallelogram (5,6) (-7,6) 5, 4 7, 4 Sol.pdf
 
What is return on equity What is net profit margin What is total as.pdf
 What is return on equity What is net profit margin What is total as.pdf What is return on equity What is net profit margin What is total as.pdf
What is return on equity What is net profit margin What is total as.pdf
 
What is on a classified balance sheet What is on a classified b.pdf
 What is on a classified balance sheet What is on a classified b.pdf What is on a classified balance sheet What is on a classified b.pdf
What is on a classified balance sheet What is on a classified b.pdf
 
What is depreciation What is depreciation Solu.pdf
 What is depreciation  What is depreciation Solu.pdf What is depreciation  What is depreciation Solu.pdf
What is depreciation What is depreciation Solu.pdf
 
What industry controlled California politics in the late 1800s and .pdf
 What industry controlled California politics in the late 1800s and .pdf What industry controlled California politics in the late 1800s and .pdf
What industry controlled California politics in the late 1800s and .pdf
 
what functions were intergrates into the microfluidic chip projec.pdf
 what functions were intergrates into the microfluidic chip projec.pdf what functions were intergrates into the microfluidic chip projec.pdf
what functions were intergrates into the microfluidic chip projec.pdf
 
What does a Geothermal heating and cooling do (I appreciate it if yo.pdf
 What does a Geothermal heating and cooling do (I appreciate it if yo.pdf What does a Geothermal heating and cooling do (I appreciate it if yo.pdf
What does a Geothermal heating and cooling do (I appreciate it if yo.pdf
 
What does the acronym GIS stands for List any 4 (four) componentss.pdf
 What does the acronym GIS stands for  List any 4 (four) componentss.pdf What does the acronym GIS stands for  List any 4 (four) componentss.pdf
What does the acronym GIS stands for List any 4 (four) componentss.pdf
 
What distribution does the F distribution approach as the sample .pdf
 What distribution does the F distribution approach as the sample .pdf What distribution does the F distribution approach as the sample .pdf
What distribution does the F distribution approach as the sample .pdf
 
What communication skills do business value What communication.pdf
 What communication skills do business value What communication.pdf What communication skills do business value What communication.pdf
What communication skills do business value What communication.pdf
 
What assumptions are made about the population from which indepen.pdf
 What assumptions are made about the population from which indepen.pdf What assumptions are made about the population from which indepen.pdf
What assumptions are made about the population from which indepen.pdf
 
What are the various sources of conflict and politics that have p.pdf
 What are the various sources of conflict and politics that have p.pdf What are the various sources of conflict and politics that have p.pdf
What are the various sources of conflict and politics that have p.pdf
 
What are the two new civilian codes added to the modernized satellite.pdf
 What are the two new civilian codes added to the modernized satellite.pdf What are the two new civilian codes added to the modernized satellite.pdf
What are the two new civilian codes added to the modernized satellite.pdf
 
What are the main techniques of capital budgeting Can you briefl.pdf
 What are the main techniques of capital budgeting Can you briefl.pdf What are the main techniques of capital budgeting Can you briefl.pdf
What are the main techniques of capital budgeting Can you briefl.pdf
 
What are the different ways of loading a code into an AYR chipSo.pdf
 What are the different ways of loading a code into an AYR chipSo.pdf What are the different ways of loading a code into an AYR chipSo.pdf
What are the different ways of loading a code into an AYR chipSo.pdf
 
What are the differences between PSK and DPSKSolutionThe fol.pdf
 What are the differences between PSK and DPSKSolutionThe fol.pdf What are the differences between PSK and DPSKSolutionThe fol.pdf
What are the differences between PSK and DPSKSolutionThe fol.pdf
 
What are some factors used to determine whether an individual is an e.pdf
 What are some factors used to determine whether an individual is an e.pdf What are some factors used to determine whether an individual is an e.pdf
What are some factors used to determine whether an individual is an e.pdf
 
What are the current asset financing strategies that firms adopt Fi.pdf
 What are the current asset financing strategies that firms adopt  Fi.pdf What are the current asset financing strategies that firms adopt  Fi.pdf
What are the current asset financing strategies that firms adopt Fi.pdf
 
What are the areas in Transportation Engineering, where Civil Eng.pdf
 What are the areas in Transportation Engineering, where Civil Eng.pdf What are the areas in Transportation Engineering, where Civil Eng.pdf
What are the areas in Transportation Engineering, where Civil Eng.pdf
 

Recently uploaded

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Recently uploaded (20)

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 

We are given an undirected graph G = (N, E), where N is the set of no.pdf

  • 1. We are given an undirected graph G = (N, E), where N is the set of nodes and E is the set of edges. Suppose that we can color a node in the graph G so that the number of edges connected to two nodes with different colors is maximized. Formulate this problem as an integer linear program. Solution Let node i have 3 indicator variables ri, yi, bi ri = 1 if the node is red, 0 otherwise. yi = 1 if the node is yellow, 0 otherwise. bi= 1 if the node is blue, 0 otherwise. Then, let edge e ij be the edge from i to j where there is an edge in the above diagram. Thus, we have e12, e13, e15, e24, e23, e27, e35, e34, e36, e45, e46, e47, e 56, e57, and e67. We will let this have the value 1 if nodes i and j have different color and otherwise have value 0. max e12 + e13 + e15 + e24 + e23+ e27 + e35 + e34 + e36 + e45 + e46 + e47 + e56 + e57 + e67 subject to ri + rj + eij <= 2. yi + yj + eij <= 2. yi + yj + eij <= 2. for ij {12, 13, 15, 24, 23, 27, 35, 34, 36, 45, 46, 47, 56, 57, 67} Note that these inequalities work. If the colors are the same, for that color, they add to 2, so the edge has value 0, and they sum to 2 is less than or equal to 2. For the other colors, they add to 0, + 0 for the edge is 0 is less than or equal to 2. If the colors are different, then the sum over each of the 3 colors will be 1 in 2 cases and 0 in the other, so the edge will have value 1, and the sum will be 1 in 1 case and 2 in the other 2. (While the edge could have a smaller value, this would not be the solution at the maximum, so the formulation works.) At each node, we must have one of ri, yi, and b i equal to 1 and the others equal to 0. Have them sum to 1 so there is a color at each node ri + yi + bi = 1 i = 1, 2, 3, 4, 5, 6, 7 All variables are greater than or equal to 0. All variables in this problem are integers.