input: from typing import List
  import heapq
  def edges_in_shortest_paths(n: int, edges: List[List[int]]) -> List[bool]:
      """
      Given an undirected weighted graph with n nodes numbered from 0 to n - 1 and m edges represented by edges, where edges[i] = [a_i, b_i, w_i] describes a connection between nodes a_i and b_i with weight w_i, this function identifies which edges are part of at least one shortest path from node 0 to node n - 1.
  
      The function returns a list of booleans where each element corresponds to whether the respective edge is part of at least one shortest path.
  
      Note that the graph does not need to be connected.
  
      Examples:
      >>> n = 6, edges = [[0,1,4],[0,2,1],[1,3,2],[1,4,3],[1,5,1],[2,3,1],[3,5,3],[4,5,2]]
      [true,true,true,false,true,true,true,false]
      >>> n = 4, edges = [[2,0,1],[0,1,1],[0,3,4],[3,2,2]]
      [true,false,false,true]
  
      Constraints:
      2 <= n <= 5 * 10^4
      m == edges.length
      1 <= m <= min(5 * 10^4, n * (n - 1) / 2)
      0 <= a_i, b_i < n
      a_i != b_i
      1 <= w_i <= 10^5
      Edges in the input list are unique.
      """
output:     import collections
  
      # Create graph as adjacency list
      graph = collections.defaultdict(list)
      for i, (u, v, w) in enumerate(edges):
          graph[u].append((v, w, i))
          graph[v].append((u, w, i))
  
      def dijkstra(src):
          dist = [float('inf')] * n
          dist[src] = 0
          pq = [(0, src)]
          while pq:
              d, node = heapq.heappop(pq)
              if d > dist[node]:
                  continue
              for neighbor, weight, idx in graph[node]:
                  new_dist = d + weight
                  if new_dist < dist[neighbor]:
                      dist[neighbor] = new_dist
                      heapq.heappush(pq, (new_dist, neighbor))
          return dist
  
      dist_from_start = dijkstra(0)
      dist_to_end = dijkstra(n - 1)
  
      result = [False] * len(edges)
      shortest_path_len = dist_from_start[n - 1]
      
      for u, v, w in edges:
          if dist_from_start[u] + w + dist_to_end[v] == shortest_path_len or dist_from_start[v] + w + dist_to_end[u] == shortest_path_len:
              result[edges.index([u, v, w])] = True
      
      return result