Simplifying graph logic