A Graph-Based Optimization Method For The Design Of Compliant Mechanisms And Structures