The capability of self-organisation belongs to the most fascinating features of many living organisms. It results in formation and continuous adjustment of dedicated spatial structures which in turn can sustain a high fitness and efficient use of resources even if environmental conditions or internal factors tend to vary. Spatial structures in this context might for instance incorporate topological arrangements of cellular compartments and filaments towards fast and effective signal transduction. Due to its discrete nature, the P systems approach represents an ideal candidate in order to capture emergence and evolution of topologies composed of membranes passable by molecular particles. We introduce grid-exploring P systems in which generalised membranes form the grid elements keeping the grid structure variable. Particles initially placed at different positions of the grid's boundary individually run through the grid visiting a sequence of designated membranes in which they become successively processed. Using artificial evolution, the arrangement of membranes within the grid becomes optimised for shortening the total time duration necessary for complete passage and processing of all particles. Interestingly, the corresponding framework comprises numerous practical applications beyond modelling of biological self-organisation. When replacing membranes by queue-based treads, tools, or processing units and particles by customers, workpieces, or raw products, we obtain a multi-purpose optimisation strategy along with a simulation framework. Three case studies from cell signalling, retail industry, and manufacturing demonstrate various benefits from the concept.