Add constants and building graph structure