Assuming all instances are vaild (meaning their reference belongs in a proper library inside a netlist). :param instances: :param netlist: :return: