We introduce a new nature inspired algorithm to solve the Graph Coloring Problem (GCP): the Gravitational Swarm. The Swarm is composed of agents that act individually, but that can solve complex computational problems when viewed as a whole. We formulate the agent’s behavior to solve the GCP. Agents move as particles in the gravitational field defined by some target objects corresponding to graph node colors. Knowledge of the graph to be colored is encoded in the agents as friend-or-foe information. We discuss the convergence of the algorithm and test it over well-known benchmarking graphs, achieving good results in a reasonable time.