Simple and effective linear local algorithms for agents movement and allocation on a line and on a circle are proposed. It is based on the following assumptions: 1) the total number of agents in the system is unknown 2) the future position of each agent is defined by its own coordinates and coordinates of its closest neighbors 3) one or both of boundary agents may be fixed or movable. Stability and convergence for developed systems are proven and a number of examples demonstrate the work of the proposed algorithms.