<jupyter_start><jupyter_text>The dijkstra algorithm is SSSP (Single Source Shortest Path), given a source node find the shortest path for all other nodes.<jupyter_code>from time import time
import numpy as np
import os
from graph_utils.GraphPro import GraphPro as gp
os.system('clear')
print('<----------Test Create---------->\n')
weights = [1, 2, 3, 4, 5, 6, 7, 8, 9]
graph = gp.create_graph(6, .75, weights)
graph.print_r()
print('-----------------Incremental-----------------')
data = graph.dynamic_incremental_random_vertex(weights)
graph.print_r()
graph.draw()
graph.draw(with_weight=False)
weights = [1, 2, 3, 4, 5]
graph = gp.create_graph(6, .75, weights, directed=False)
graph.print_r()
print('.........................')
t = time()
print(graph.apsp_dijkstra())
elapsed = time() - t
print("Time: ", elapsed)
 
graph.draw()<jupyter_output>Source:  [0. 2. 0. 4. 1. 3. 1. 4. 1. 5. 2. 3. 2. 5. 3. 4. 4. 5.]
Target:  [2. 0. 4. 0. 3. 1. 4. 1. 5. 1. 3. 2. 5. 2. 4. 3. 5. 4.]
Weight:  [2. 2. 5. 5. 2. 2. 3. 3. 1. 1. 5. 5. 3. 3. 4. 4. 4. 4.]
Vertex:  [0. 1. 2. 3. 4. 5.]
.........................
[[0. 6. 2. 7. 5. 5.]
 [6. 0. 4. 2. 3. 1.]
 [2. 4. 0. 5. 7. 3.]
 [7. 2. 5. 0. 4. 3.]
 [5. 3. 7. 4. 0. 4.]
 [5. 1. 3. 3. 4. 0.]]
Time:  0.005679607391357422
{'fraction_non_alphanumeric': 0.2688, 'fraction_numerical': 0.108, 'mean_word_length': 1.9574468085106382, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '597032', 'license': 'Apache-2.0', 'n_tokens_mistral': 636, 'n_tokens_neox': 517, 'n_words': 183, 'path': 'testing/jaak-it_demo/05_JaakIt_Kruskal_algorithm.ipynb', 'repo_name': 'jaak-it/dshub_examples', 'size': '1250'}