The basic difference, I would say, is that given a set of nodes, Dijkstra's algorithm finds the shortest path between 2 nodes. Which does not necessarily cover all the nodes in the graph.
However on Kruskal's case, the algorithm tries to cover all the nodes while keeping the edge cost minimum.
Consider this graph:
E
3 / |
B | 3
5 /3\ |
/ D
A | 2
\ F
1 \ / 1
C
2 \
G
Dijkstra's algorithm will return the path A-C-F-D-E
for source and destination nodes A
and E
, at a total cost of 7
. However Kruskal's algorithm should cover all the nodes, therefore it will consider edges [AC]
, [CG]
, [CF]
, [FD]
, [DB]
and [DE]
with a total cost of 12
.
In Dijkstra, the irrelevant nodes (ones that are not in the path from source the destination) are ignored, e.g., G
and B
in this case. The resulting path, of course, is a tree but does not cover all the nodes. There might be millions of nodes connected to G
(assuming they are not connected to other nodes) which would not be in the path of the Dijkstra's result. On the other hand, Kruskal had to add those nodes to the resulting tree.