Suppose you are given an n x n grid graph G, as in Figure 1.
Associated with each node v is a weight w(v), which is a nonnegative integer. You may assume that the weights of all nodes are distinct. Your goal is to choose an independent set S of nodes of the grid, so that the sum of the weights of the nodes in S is as large as possible. (The sum of the weights of the nodes in S will be called its total weight.)
Consider the following greedy algorithm for this problem.
(a) Let S be the independent set returned by the "heaviest-first" greedy algorithm, and let T be any other independent set in G. Show that, for each node v e T, either v e S, or there is a node v' ε S so that w(v) ≤ w(v') and (v, v') is an edge of G.
(b) Show that the "heaviest-first" greedy algorithm returns an independent set of total weight at least1 times the maximum total weight of any independent set in the grid graph G.
Figure 1. A grid graph.

We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.