def check_next_match(self, match, new_relations, subject_graph, one_match):
if not CustomPattern.check_next_match(self, match, new_relations, subject_graph, one_match):<EOL><INDENT>return False<EOL><DEDENT>if self.strong:<EOL><INDENT>vertex1_start = match.forward[self.pattern_graph.central_vertex]<EOL>for vertex1 in new_relations.values():<EOL><INDENT>paths = list(subject_graph.iter_shortest_paths(vertex1, vertex1_start))<EOL>if self.size % <NUM_LIT:2> == <NUM_LIT:0> and len(match) == self.size:<EOL><INDENT>if len(paths) != <NUM_LIT:2>:<EOL><INDENT>return False<EOL><DEDENT>for path in paths:<EOL><INDENT>if len(path) != len(match)//<NUM_LIT:2>+<NUM_LIT:1>:<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if len(paths) != <NUM_LIT:1>:<EOL><INDENT>return False<EOL><DEDENT>if len(paths[<NUM_LIT:0>]) != (len(match)+<NUM_LIT:1>)//<NUM_LIT:2>:<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return True<EOL>
Check if the (onset for a) match can be a valid (part of a) ring