  We develop an agent-based model on a lattice to investigate territorial
development motivated by markings such as graffiti, generalizing a
previously-published model to account for $K$ groups instead of two groups. We
then analyze this model and present two novel variations. Our model assumes
that agents' movement is a biased random walk and that the agents' movement is
away from rival groups' markings. All interactions between agents is indirect,
mediated through the markings. We numerically demonstrate that in a system of
three groups, the groups segregate in certain parameter regimes. Starting from
the discrete model, we also formally derive the continuum system of $2K$
convection-diffusion equations for our model. These equations exhibit
cross-diffusion due to the avoidance of the rival groups' markings. Linear
stability analysis is performed to study the phase transition that the system
undergoes as parameters are varied. Two new variations of the model are
introduced and numerically studied. Both exhibit a phase transition, with
segregation dynamics that are distinct both from each other and from the
original model.
