def METHOD_NAME(self, graph_connector: LibraryGraph) -> LibraryGraph:
    # no need to create a subgraph, if there are no vertices to be checked
    if not self.vertices_under_resource_types:
        return graph_connector
    if isinstance(graph_connector, Graph):
        resource_nodes = {
            vertex for vertex in graph_connector.vs.select(resource_type_in=self.targeted_resources_types)
        }
        connection_nodes = {
            vertex for vertex in graph_connector.vs.select(block_type__in=BaseConnectionSolver.SUPPORTED_CONNECTION_BLOCK_TYPES)
        }
    else:
        resource_nodes = {
            node
            for node, resource_type in graph_connector.nodes(data=CustomAttributes.RESOURCE_TYPE)
            if resource_type in self.targeted_resources_types
        }
        # tuple needs to be adjusted, if more connection block types are supported
        connection_nodes = {
            node
            for node, block_type in graph_connector.nodes(data=CustomAttributes.BLOCK_TYPE)
            if block_type in BaseConnectionSolver.SUPPORTED_CONNECTION_BLOCK_TYPES
        }
    resource_nodes.update(connection_nodes)
    return graph_connector.subgraph(resource_nodes)