input: Write a function to find the shortest path in a graph using the Travelling Salesman Problem (TSP) algorithm.
  assert tsp({'A': {'B': 10, 'C': 15, 'D': 20}, 'B': {'A': 10, 'C': 35, 'D': 25}, 'C': {'A': 15, 'B': 35, 'D': 30}, 'D': {'A': 20, 'B': 25, 'C': 30}}, 'A', 'D') == ['A', 'B', 'D']
  assert tsp({'A': {'B': 5, 'C': 10}, 'B': {'A': 5, 'C': 3}, 'C': {'A': 10, 'B': 3}}, 'A', 'C') == ['A', 'B', 'C']
  assert tsp({'A': {'B': 2, 'C': 5}, 'B': {'A': 2, 'C': 4}, 'C': {'A': 5, 'B': 4}}, 'A', 'C') == ['A', 'B', 'C']
output: def tsp(graph, start, end):
      from itertools import permutations
      
      nodes = list(graph.keys())
      nodes.remove(start)
      
      min_path = None
      min_cost = float('inf')
      
      for perm in permutations(nodes):
          current_cost = 0
          current_path = [start]
          current_node = start
          
          for next_node in perm:
              current_cost += graph[current_node][next_node]
              current_path.append(next_node)
              current_node = next_node
          
          current_cost += graph[current_node][end]
          current_path.append(end)
          
          if current_cost < min_cost:
              min_cost = current_cost
              min_path = current_path
      
      return min_path