Let's take a $m \times n$ matrix as an area with $m \times n$ blocks (likes a 2D-version of the world in Minecraft). We have to put some lamps in this matrix to illuminate the whole matrix. Here is the rule:

1: The light of the lamps spread only in 4 directions: up, down, left and right.

2: The light can spread to any distance unless it meets an obstacle or the boundary of this matrix.

3: Obstacle is a kind of elements in this matrix that any light can't spread through it.

4: The location of a lamp is illuminated by itself.

Now the task is to establish an algorithm that can illuminate the whole matrix with the least lamps.

The problem seems to be a variant of Art Gallery Problem, but it's not easy to apply the solution for Art Gallery Problem to this one.

I tried Greedy algorithm: Compuate $I_{ij}:=$ #{ blocks can be illuminated by putting a lamp at $a_{ij}$}, then put a lamp at $a_{i_0j_0}$, which $I_{i_0j_0}=\max{I_{ij}}$. Repeat this step, until all the empty blocks( the non-obstacle blocks).

It turn out to be that my method can't provide the number I need. It's not strong enough to get the minimal number of lamps.