Filter out the patterns that have links only contain variable nodes.