<jupyter_start><jupyter_text>Post submission optimisation- new optimised `a_star` algorithm in `Utils.Graph`.<jupyter_code>st = time.time()
multiplicator = int(grid.mean()/2)
opt_path = Utils.a_star(
    start=(0, 0),
    goal=(len(grid)-1, len(grid)-1),
    estimate=lambda x,y: (abs(x[0]-y[0]) + abs(x[1]-y[1])) * multiplicator,
    weight=lambda f,t: grid[t],
    get_neighbours=lambda co: Utils.get_neighbours(co, dimensions=((0, len(grid)-1), (0, len(grid)-1)))
)
print(f'{time.time() - st:.2f}s')
print(f'{sum([grid[el] for el in opt_path[1:]]):.2f}')<jupyter_output>7.36s
2846.00
{'fraction_non_alphanumeric': 0.2167235494880546, 'fraction_numerical': 0.042662116040955635, 'mean_word_length': 5.670454545454546, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '419506', 'license': 'MIT', 'n_tokens_mistral': 266, 'n_tokens_neox': 255, 'n_words': 41, 'path': 'AdventOfCode 2021/day 15.ipynb', 'repo_name': 'BhasherBEL/ProgrammingChallenges', 'size': '586'}