목록경로찾기 (1)
일상 코딩
[python/파이썬] 미로찾기: DFS 깊이 우선 탐색 알고리즘 방법 적용
maze.py from enum import Enum from typing import List, NamedTuple, Callable, Optional import random from math import sqrt from urllib.parse import MAX_CACHE_SIZE from generic_search import dfs, node_to_path, Node #, bfs, astar class Cell(str, Enum): EMPTY = " " BLOCKED = "X" START = "S" GOAL = "G" PATH = "*" class MazeLocation(NamedTuple): row: int column: int class Maze: def __init__(self, rows..
Python/고전 컴퓨터 알고리즘
2022. 4. 19. 22:34