Graph-based CAD tool