Classic Graphplan has too much restriction on capturing the full subtlety of many real problems. Flexible Graphplan is defined which supports the soft constraints often found in reality. Heuristic concept is introduced to the process of plan extraction in flexible graphplan in order to improve the efficiency of plan extraction and the quality of plan. A novel algorithm using the new heuristic function which is applied by improved sum mutex heuristic to deal with planning problems is proposed. Sum mutex heuristic which is in common use as heuristic function takes into account only static propositional mutexes, and ignores the mutexes of actions. The performance of the new algorithm on many benchmark problems is remarkably robust. It can solve many planning problems, which can't be solved by the heuristic state space search planning system using sum mutex heuristic.