Boundaries, hierarchies and networks in complex systems