- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hello! (Wave)
We consider a long country road with $n$ houses placed along of it (we think of the road as a big line segment). We want to put antenna of wireless internet in some places of the road so that we cover with signal all the houses. Each antenna has a range of $k$ meters and can cover as many houses are in its range. I want to describe a greedy algorithm that achieves this goal using the minimum number of antenna. I also want to compute the complexity and prove the correctness of the greedy algorithm. (The input of the algorithm is an array $A[1 \dots n]$, that contains the distances of the houses in an increasing order from the west side of the road. The output of the algorithm will be the number of antenna that were used in total.)
Can you give me a hint what we could do? (Thinking)
We consider a long country road with $n$ houses placed along of it (we think of the road as a big line segment). We want to put antenna of wireless internet in some places of the road so that we cover with signal all the houses. Each antenna has a range of $k$ meters and can cover as many houses are in its range. I want to describe a greedy algorithm that achieves this goal using the minimum number of antenna. I also want to compute the complexity and prove the correctness of the greedy algorithm. (The input of the algorithm is an array $A[1 \dots n]$, that contains the distances of the houses in an increasing order from the west side of the road. The output of the algorithm will be the number of antenna that were used in total.)
Can you give me a hint what we could do? (Thinking)