[{'role': 'system', 'content': "You are an expert in machine learning and your task is to classify code snippets into one of the following categories: ['helper_functions', 'load_data', 'data_exploration', 'data_preprocessing', 'evaluation', 'modelling', 'prediction', 'result_visualization', 'save_results', 'comment_only']."}, {'role': 'user', 'content': 'Identify the single most appropriate category to which the provided code belongs. Provide your response as a single category label without any additional information, commentary, or personal opinions.\\nPython Code:class Graph():\n    def __init__(self):\n        """\n        self.edges is a dict of all possible next nodes\n        e.g. {\'X\': [\'A\', \'B\', \'C\', \'E\'], ...}\n        self.weights has all the weights between two nodes,\n        with the two nodes as a tuple as the key\n        e.g. {(\'X\', \'A\'): 7, (\'X\', \'B\'): 2, ...}\n        """\n        self.edges = defaultdict(list)\n        self.weights = {}\n    \n    def add_edge(self, from_node, to_node, weight, back_penalty=1):\n        # Note: assumes edges are bi-directional\n        self.edges[from_node].append(to_node)\n        self.edges[to_node].append(from_node)\n        self.weights[(from_node, to_node)] = weight\n        self.weights[(to_node, from_node)] = weight*back_penalty\n\ndef dijsktra(graph, initial, end):\n    # shortest paths is a dict of nodes\n    # whose value is a tuple of (previous node, weight)\n    shortest_paths = {initial: (None, 0)}\n    current_node = initial\n    visited = set()\n    \n    while current_node != end:\n        visited.add(current_node)\n        destinations = graph.edges[current_node]\n        weight_to_current_node = shortest_paths[current_node][1]\n\n        for next_node in destinations:\n            weight = graph.weights[(current_node, next_node)] + weight_to_current_node\n            if next_node not in shortest_paths:\n                shortest_paths[next_node] = (current_node, weight)\n            else:\n                current_shortest_weight = shortest_paths[next_node][1]\n                if current_shortest_weight > weight:\n                    shortest_paths[next_node] = (current_node, weight)\n        \n        next_destinations = {node: shortest_paths[node] for node in shortest_paths if node not in visited}\n        if not next_destinations:\n            raise Exception("Something is wrong")\n        # next node is the destination with the lowest weight\n        current_node = min(next_destinations, key=lambda k: next_destinations[k][1])\n    \n    # Work back through destinations in shortest path\n    path = []\n    dist = 0\n    while current_node is not None:\n        path.append(current_node)\n        next_node = shortest_paths[current_node][0]\n        dist += shortest_paths[current_node][1]\n        current_node = next_node\n    # Reverse path\n    path = path[::-1]\n    return path, dist\n        \''}, {'role': 'assistant', 'content': 'helper_functions'}]