<commit_before>class UniformCostSearch < SearchAlgorithm

    def search
        @list = [[0, @start]]
        until @list.empty?
            @history << @list.clone
            cost, parent_node = self.remove_node
            @cache[parent_node.key] = parent_node.key
            @traversal << [cost, parent_node]
            return if parent_node == @goal
            parent_node.edges.each do |edge|
                node = edge.node
                cost = edge.cost
                if not @cache or not @cache.has_key? node.key
                    @cache[node.key] = node
                    unless @tree.has_key? node
                        @tree[node] = parent_node
                    end
                    self.insert_node node, cost
                end
            end
        end<commit_msg>Corrected mistake in uniform cost search<commit_after>class UniformCostSearch < SearchAlgorithm

    def search
        @list = [[0, @start]]
        until @list.empty?
            @history << @list.clone
            cost, parent_node = self.remove_node
            @cache[parent_node.key] = parent_node.key
            @traversal << [cost, parent_node]
            return if parent_node == @goal
            pcost = cost
            parent_node.edges.each do |edge|
                node = edge.node
                cost = edge.cost + pcost
                if not @cache or not @cache.has_key? node.key
                    @cache[node.key] = node
                    unless @tree.has_key? node
                        @tree[node] = parent_node
                    end
                    self.insert_node node, cost
                end
            end
        end
{'fraction_non_alphanumeric': 0.07923169267707082, 'fraction_numerical': 0.0012004801920768306, 'mean_word_length': 1.2618724559023067, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5078946', 'n_tokens_mistral': 443, 'n_tokens_neox': 415, 'n_words': 111}