Flexible Graph Similarity Computation With A Proactive Optimization Strategy