I've been trying to find an optimal algorithm for a problem inspired by the game 'triple town'. The game goes as such:
You place objects in a grid, and each time you make a set of three, they condense into one object of higher level at the position of the last object placed.

Furthermore, if you place three of these b objects together they again compress to form an even higher level object.


Note: in these diagrams the level of an object is expressed as ai, bi, and ci and the subscript denotes the objects number in the set of three.
To simplify things, I am only considering when every object you have to place is of the lowest level.
Now my questions are:
1: Is there an algorithm to determine the least amount of grid area needed to make an object of level x, given x?
For example, for level a you need 1x1, for level b you need 1x3, for level c you need 1x5.
2: Given the dimensions of a grid, can we find the highest level and number of objects achievable?
For example, for a 2x2 you can get 2 level 'a's and 2 level 'b's
3: Is there an algorithm to find the optimal order and position of objects to get the highest possible level, given a fixed grid?
For example, for a 2x2 you can get (1,1),(1,2),(2,2)
4: Given a position of an intended level x object, what set of moves minimize the amount of space needed to make this object?
5:What are the optimal complexities of these algorithms?
Update:
One thing that I think is prominent in the finding of solutions is that the getting an item of level x can't be done in any arbitrary place.
For instance: [ _ _ _ _ c] is impossible to achieve in a fixed 1 by 5 grid because you need your last b in the 5th place, and therefore your last a in the 5th place. So to place the first b: [a _ _ _ _]->[a a _ _ _]->[_ _ b _ _] or [_ a _ _ _]->[_ a a _ _]->[_ _ _ b _]. In both cases there is not enough room to place 3 'a's to make the last b of the c.
Another thing, we can't assume that anything can be unrolled to a 1 dimensional grid. This becomes clear with my next point.
Something interesting that I have found:
There is a minimum closeness to the boundary that a level c object can be in a 1 dimensional grid. [_ _ a a a]->[_ _ _ b]->[_ a a a b]->[_ _ _ b b]->[a a a b b]->[_ _ c _ _]. So a level c object in a 1 by 5 (optimal) grid can only be made at the 3rd position.
It follows that this is the highest level that can be made in 1 by any number grid. Take a 1 by infinity grid:
..._ a a a _ ... -> ... _ a a a b _ ... -> ... _ a a a b b _ ... -> ... _ c _ ...
now we try to get another c directly next to it:
..._ c a a a _ ... = ... _ c b _ ... or ... _ c _ b _ ... or ... _ c _ _ b _ ...
The only option is ..._ c b _ ... because the others make it impossible to form another b between c and b. Our only option prevents our only way to create c directly next to our first c because it blocks the last c from going there. Therefore, in one dimension, c is the highest level we can make. In other words, the problem must be considered in 2 dimensions.