Go - Djikstra + Dynamic Programming
Code
# Code
```golang []
package main

import (
	"container/heap"
	"fmt"
	"math"
	"sort"
)

const MOD = 1_000_000_007

// PriorityQueue implements a min-heap
type PriorityQueue []Node

type Node struct {
	dist int
	id   int
}

func (pq PriorityQueue) Len() int            { return len(pq) }
func (pq PriorityQueue) Less(i, j int) bool  { return pq[i].dist < pq[j].dist }
func (pq PriorityQueue) Swap(i, j int)       { pq[i], pq[j] = pq[j], pq[i] }
func (pq *PriorityQueue) Push(x interface{}) { *pq = append(*pq, x.(Node)) }
func (pq *PriorityQueue) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	*pq = old[:n-1]
	return item
}

func countRestrictedPaths(n int, edges [][]int) int {

	graph := make(map[int][][]int)
	for i := 1; i <= n; i++ {
		graph[i] = [][]int{}
	}
	for _, edge := range edges {
		u, v, weight := edge[0], edge[1], edge[2]
		graph[u] = append(graph[u], []int{weight, v})
		graph[v] = append(graph[v], []int{weight, u})
	}

	distance := make([]int, n+1)
	for i := range distance {
		distance[i] = math.MaxInt64
	}
	distance[n] = 0

	pq := &PriorityQueue{}
	heap.Init(pq)
	heap.Push(pq, Node{dist: 0, id: n})

	for pq.Len() > 0 {
		curr := heap.Pop(pq).(Node)
		node, weight := curr.id, curr.dist

		if weight > distance[node] {
			continue
		}

		for _, neighbor := range graph[node] {
			nweight, nnode := neighbor[0], neighbor[1]
			newWeight := weight + nweight
			if newWeight < distance[nnode] {
				distance[nnode] = newWeight
				heap.Push(pq, Node{dist: newWeight, id: nnode})
			}
		}
	}

	dp := make([]int, n+1)
	dp[n] = 1

	nodes := make([]int, n)
	for i := 1; i <= n; i++ {
		nodes[i-1] = i
	}

	sort.Slice(nodes, func(i, j int) bool {
		return distance[nodes[i]] < distance[nodes[j]]
	})

	for _, node := range nodes {
		if node == n {
			continue
		}
		for _, neighbor := range graph[node] {
			nnode := neighbor[1]
			if distance[node] > distance[nnode] { // Only count valid restricted paths
				dp[node] = (dp[node] + dp[nnode]) % MOD
			}
		}
	}

	return dp[1]
}

```
['Dynamic Programming', 'Graph', 'Topological Sort', 'Heap (Priority Queue)', 'Shortest Path', 'Go']