# algorithm for placing n objects in n places

We have n objects to place in n locations, provided the following constrains

1 - All objects must be placed

2 - All places must be taken

3 - Each object can only be placed in certain locations (a subset of locations).

As an special example consider a 7x7 grid (see image link below), with 24 blue letters (A-X) in the periphery, and 24 available locations in the grid. Each letter can be place in a cell from corresponding row or column, and the letters at the corners can be placed in a cell from corresponding diagonal.

Is there any non-brute-force algorithm for this problem? image link: http://snag.gy/lojaM.jpg

• What is the problem precisely? Do you want to find one possible fill-in, or enumerate all possible fill-ins, or get a count of all possible fill-ins? Commented Aug 11, 2013 at 13:41
• to enumerate all fill-ins, or at least have one Commented Aug 11, 2013 at 13:46
• Hmm. Enumerating all fill-ins is what I would consider "brute force". I suppose then that your "non-brute-force algorithm" means an algorithm that does not need to try many invalid configurations. Commented Aug 11, 2013 at 13:49