DJ and Mark are very lazy guys. These are not the guys from some game, these are the ones playing games all the time. Recently, they bought a new game named "Graph Vertices chooser". The rules of this...


Computer Engineering lab


DJ and Mark are very lazy guys. These are not the guys from some game, these<br>are the ones playing games all the time. Recently, they bought a new game<br>named

Extracted text: DJ and Mark are very lazy guys. These are not the guys from some game, these are the ones playing games all the time. Recently, they bought a new game named "Graph Vertices chooser". The rules of this game are pretty simple. It's a two-player game with each player taking alternating turns starting with DJ. You are given a weighed graph. All the vertices are initially unmarked. In each turn, a player chooses an unmarked vertex and mark it to red or black colour (DJ marks red whereas Mark marks black). The game ends when there is no any unmarked vertex left. After the end of the game, DJ's score will be weight of all the edges in graph such that both the end points of the edge are coloured red. Similarly, score of Mark is sum of weight of edges with both end points being black. DJ would like to maximize difference between his and Mark points, while Mark would like to minimize the difference between DJ's and his score. Both players optimally. Now, you are the one who decided to be the coach of both the players. You want to create many graphs for DJ and Mark to train. For that, you decided to take a graph H of N vertices. Initially, there is no edge in graph H. One by one, you will add an edge in the graph H and ask the both the players to play on the newly created graph. You will add M such edges. For each of the M graphs, you have to tell the difference between points of DJ and Mark at the end of the game, when they play the game on that graph. Note that self-loops and multi-edges are allowed to exist. Develop C++ develop code for the problem. Input: 1 54 121 131 141 151 Output: 1
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here