I wrote
In this formula, the number of nodes is multiplied to (P + A), because each node must be checked against the list of anchors, and if it matches any of them, a pattern must be retrieved from the list of patterns.
Could it be written as
In this formula, the number of nodes is multiplied to (P + A) because for each node it (the node) must be checked against the list of anchors, and if it matches any of them, a pattern must be retrieved from the list of patterns.