I found a video showing formation movement at around 10 seconds in. When he gives a move order, the formation moves in a narrow column facing forwards, and when it reaches destination, the formation stands still, but each soldier changes direction so that it's now a wide formation facing the enemy. What algorithms are behind this kind of movement?