An optimization algorithm which optimizes the sequence of firewall rules to reduce packet matching time is presented. It has seen observed that some incoming packet can match with more than one rule. This rules are called as dependent rules and if their action differs then it is called as conflict or divergence. The authors' focus attention is in this paper is on dependent rules. This paper proposes an algorithm that is designed for divergence resolution and gives good network performance by reducing the packet matching time of the firewall.