[CODE ONLY] PYTHON USING Chaman Rawat's BFS HEAP SOLUTION
Code
# Code
```python3 []
# Using Chaman Rawat's solution...
# LINK: https://leetcode.com/problems/minimize-the-maximum-edge-weight-of-graph/solutions/6267672/finding-shortest-paths-in-a-reversed-gra-nmza
class Solution:
    def minMaxWeight(self, n: int, edges: List[List[int]], threshold: int) -> int:
        
        children_to_parents = defaultdict(list)
        is_reachable = set()

        def makeNodesToChildren(edge_graph: List[List[int]]) -> dict[int, tuple[int, int]]:
            for each_edge in edge_graph:
                parent, child, weight = each_edge
                parent_pair = (parent, weight)  # node, weight
                children_to_parents[child].append(parent_pair)
            return children_to_parents

        makeNodesToChildren(edges)

        max_visited_weight = 0
        node_is_checked = set()

        smallest_weights_heap = [(0, 0)]

        while smallest_weights_heap:
            weight, node = heappop(smallest_weights_heap)
            if node in node_is_checked:
                continue
            node_is_checked.add(node)

            max_visited_weight = max(max_visited_weight, weight)
            for each_parent, each_weight in children_to_parents[node]:
                heappush(smallest_weights_heap, (each_weight, each_parent) )

        if len(node_is_checked) == n:
            return max_visited_weight
        return -1
```
['Python3']