Rule-based autocorrection of Piping and Instrumentation Diagrams (P&IDs) on graphs