PDF download Download Article PDF download Download Article

A skyscrapers puzzle requires determining the heights of a grid of buildings. Numbers at the edges of the grid tell the number of skyscrapers visible from that direction. Taller buildings block the view of all lower buildings behind them. Each row and column must have exactly one building of each height.

  1. In some cases, these will be equal and the entire grid will be filled with skyscrapers. In others, there may be some empty spaces or parks. Subtract the length of the rows from the number of heights to find the number of parks in each row. In this example, it is stated that there are four buildings heights. In the 5x5 grid, that means one park in each row and column.
  2. The tallest building will block everything else in that row or column and therefore cannot be placed next to any digit other than 1. If there are multiple 1's in a row, all but one of them must be a park. Since this example has four heights in a 5x5 grid, each row and column contains only one park. Use the + symbol to indicate cells where the height is still unknown, but cannot be a park. Identifying the locations of the parks is a significant step towards the solution.
    Advertisement
  3. When a building of maximum height is found, there must be at least as many other buildings between it and each edge as the number of buildings visible from that edge.
  4. If the number of visible buildings equals the total number of building heights, they must be in increasing height. If the location of all park squares in that row or column are also known, then that row can be fully solved.
  5. For example, the second row could be either 4123 or 4132, but only 4132 has three buildings visible from the right. Therefore the right edge must be height 2, since you already know it can't be empty.
  6. In the example, since the maximum height is 4, a three can only be placed on an edge where the number of visible buildings is 2 (only itself and a 4 at some further locations can be seen). Along the top and right, there is only one possibility.
  7. With the 3 and 4 placed, the top row must be 3421 to have three buildings visible from the right and the first column must be 3412 to have two buildings visible from below. Consider marking rows and columns whose constraints have been fully met. These won't always be completely solved––the location of the 3 in the second row is not yet known, but in either available location, the left side will see only 4, while the right side will see 234, so those numbers will provide no more information.
  8. Look for heights that have been mostly placed and use the Latin square constraint to place remaining buildings of that height. In this example, four of the five height 2 buildings have been found, so there is only one place for the last one.
  9. In the example, the fourth row can only have two buildings visible form the left, not the required 3, if the first cell is empty. Therefore the park squares of both the third and fourth rows can be determined.
  10. Advertisement


Expert Q&A

Ask a Question
      Advertisement

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      References

      1. Example puzzle by Maarten, from http://www.puzzlepicnic.com/puzzle?468 Puzzle Picnic #468

      About This Article

      Thanks to all authors for creating a page that has been read 48,935 times.

      Did this article help you?

      Advertisement