Skip to main content
QUICK REVIEW

[논문 리뷰] A fast algorithm for All-Pairs-Shortest-Paths suitable for neural networks

Zeyu Jing, Markus Meister|PubMed|2023. 08. 06.
Data Management and AlgorithmsComputer Science인용 수 3
한 줄 요약

이 논문은 가중치가 부여된 인접행렬의 행렬 역행렬을 사용하여 모든 쌍의 최단경로(APSP)를 계산하는 새로운, 미분 가능한 알고리즘을 제안한다. 여기서 최단경로 거리는 복소수 해석행렬(resolvent matrix)의 로그 변환을 통해 유도된다. 이 방법은 빠르고 확장 가능하며 신경망에 의해 구현 가능한 그래프 거리 계산을 가능하게 하며, 적절한 γ 선택 조건 하에서 정확도가 보장된다.

ABSTRACT

Given a directed graph of nodes and edges connecting them, a common problem is to find the shortest path between any two nodes. Here we show that the shortest path distances can be found by a simple matrix inversion: If the edges are given by the adjacency matrix <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:msub><mml:mi>A</mml:mi> <mml:mrow><mml:mi>i</mml:mi> <mml:mi>j</mml:mi></mml:mrow> </mml:msub> </mml:math> then with a suitably small value of <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>γ</mml:mi></mml:math> the shortest path distances are <DispFormula> <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow><mml:msub><mml:mi>D</mml:mi> <mml:mrow><mml:mi>i</mml:mi> <mml:mi>j</mml:mi></mml:mrow> </mml:msub> <mml:mo>=</mml:mo> <mml:mtext>ceil</mml:mtext> <mml:mrow><mml:mo>(</mml:mo> <mml:mrow> <mml:msub><mml:mrow><mml:mi>log</mml:mi></mml:mrow> <mml:mi>γ</mml:mi></mml:msub> <mml:msub> <mml:mrow><mml:mrow><mml:mo>[</mml:mo> <mml:mrow> <mml:msup><mml:mrow><mml:mo>(</mml:mo> <mml:mstyle><mml:mi>I</mml:mi></mml:mstyle> <mml:mo>-</mml:mo> <mml:mi>γ</mml:mi> <mml:mstyle><mml:mi>A</mml:mi></mml:mstyle> <mml:mo>)</mml:mo></mml:mrow> <mml:mrow><mml:mo>-</mml:mo> <mml:mn>1</mml:mn></mml:mrow> </mml:msup> </mml:mrow> <mml:mo>]</mml:mo></mml:mrow> </mml:mrow> <mml:mrow><mml:mi>i</mml:mi> <mml:mi>j</mml:mi></mml:mrow> </mml:msub> </mml:mrow> <mml:mo>)</mml:mo></mml:mrow> </mml:mrow> </mml:math> </DispFormula> We derive several graph-theoretic bounds on the value of <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>γ</mml:mi></mml:math> , and explore its useful range with numerics on different graph types. Even when the distance function is not globally accurate across the entire graph, it still works locally to instruct pursuit of the shortest path. In this mode, it also extends to weighted graphs with positive edge weights. For a wide range of dense graphs this distance function is computationally faster than the best available alternative. Finally we show that this method leads naturally to a neural network solution of the all-pairs-shortest-path problem.

연구 동기 및 목표

  • 신경망 아키텍처에 적합한, 미분 가능하고 빠르며 확장 가능한 모든 쌍의 최단경로(APSP) 계산 알고리즘 개발
  • 행렬 역행렬 (I - γA)⁻¹의 성질을 활용하여 로그 변환을 통해 방향성과 가중치가 있는 그래프에서도 정확한 최단경로 거리를 도출할 수 있음을 보여줌
  • 밀도가 높은 그래프에서 기존의 APSP 알고리즘보다 빠른 계산 성능을 보이며, 아날로그 또는 뉴모르픽 하드웨어에 적합함을 입증함
  • 반복 신경 회로를 통해 R-거리 값을 계산하는 데 기반한 뇌 내 경로 탐색의 생물학적으로 타당한 메커니즘 제공
  • 거리 추정의 局부적 및 전역적 정확도를 보장하기 위해 γ를 선택하는 실용적 프레임워크 제공

제안 방법

  • 거리 계산은 R-거리 공식 R_ij(γ) = log[(I - γA)⁻¹]_ij / log(γ)를 사용하며, 여기서 A는 인접행렬이고 γ는 작은 양수 스칼라이다.
  • 무중량 그래프의 경우, γ가 충분히 작을 때 R-거리가 진짜 최단경로 거리 D_ij로 반올림되며, 이는 모든 경로에 대해 γ < 1/N_ij^(k) 조건을 만족할 때 성립한다.
  • 행렬 거듭제곱에서 A를 γ^W_ij로 대체함으로써 가중치가 있는 그래프로 일반화할 수 있으며, 이는 양의 정수 가중치를 행렬의 거듭제곱에 포함시켜 표현할 수 있음을 의미한다.
  • 이 방법은 복소수 해석행렬 (I - γA)⁻¹의 멱급수 전개 (I - γA)⁻¹ = I + γA + γ²A² + ... 를 활용하며, 이는 γ^k에 가중치가 부여된 모든 경로 수의 합을 의미한다.
  • 이 알고리즘은 연속 시간 동역학을 통해 구현 가능한 연속형 행렬 역행렬 및 로그 연산을 통해 아날로그 또는 신경망 하드웨어에 자연스럽게 적합하다.
  • 네트워크는 동적으로 반응한다: 간선 가중치나 입력 노드가 변경되면 즉각적으로 출력이 갱신되어 실시간 경로 탐색이 가능하다.
Figure 1: Performance of the R-distance. Each row represents a family of graphs illustrated by the icon on the left, with node numbers given in the legend. Global: Global performance: fraction of distances between nodes predicted correctly by Eqn 10 , as a function of the gain parameter $\gamma$ . L
Figure 1: Performance of the R-distance. Each row represents a family of graphs illustrated by the icon on the left, with node numbers given in the legend. Global: Global performance: fraction of distances between nodes predicted correctly by Eqn 10 , as a function of the gain parameter $\gamma$ . L

실험 결과

연구 질문

  • RQ1수정된 인접행렬의 행렬 역행렬이 방향성과 가중치가 있는 그래프에서 정확한 최단경로 거리를 도출할 수 있는가?
  • RQ2R-거리 근사치의 국부적 및 전역적 정확도를 보장하기 위해 최적의 γ 범위는 무엇인가?
  • RQ3이 방법의 계산 성능는 밀도가 높은 그래프에서 고전적 APSP 알고리즘(Floyd-Warshall 등)과 비교해 어떻게 되는가?
  • RQ4이 방법은 아날로그 또는 신경망 하드웨어에서 실시간 탐색을 위해 효율적으로 구현될 수 있는가?
  • RQ5R-거리 함수는 동물 뇌 내에서 경로 탐색을 위한 생물학적으로 타당한 메커니즘을 제공하는가?

주요 결과

  • γ가 모든 경로에 대해 γ < 1/N_ij^(k) 조건을 만족할 경우, R-거리 공식 R_ij(γ) = log[(I - γA)⁻¹]_ij / log(γ)는 정확한 최단경로 거리 D_ij를 도출하며, 이때 ceil(R_ij(γ)) = D_ij 가 성립한다.
  • 수천 개의 노드를 포함하는 밀도가 높은 그래프에서, 이 방법은 피보나치-워셜 등의 기존 APSP 알고리즘의 단순 구현보다 더 빠르게 작동한다.
  • 기계 정밀도 한계로 인해 전역 정확도가 손상되더라도 국부적 정확도는 유지되어 동적 환경에서 강건함을 입증한다.
  • 행렬 거듭제곱에서 A를 γ^W_ij로 대체함으로써 양의 정수 가중치를 가진 가중치가 있는 그래프로 일반화 가능하다.
  • 이 알고리즘은 아날로그 및 뉴모르픽 컴퓨팅에 자연스럽게 적합하며, 하드웨어에서 마이크로초 수준의 수렴 시간을 가질 수 있다.
  • 이 방법은 뇌 내 반복 신경 회로의 구조와 유사한 회로 모티프를 기반으로 하여 생물학적으로 타당한 경로 탐색 메커니즘을 제공한다.
Figure 2: The R-distance on weighted graphs. Results on a dense graph (as in Fig 1 D,I) with random positive edge weights. A: The R-distance plotted against the true graph distance. $V=1000$ vertices, $p=0.5$ edge probability, edge weights range from 1 to 100 with log-uniform distribution. $\gamma=1
Figure 2: The R-distance on weighted graphs. Results on a dense graph (as in Fig 1 D,I) with random positive edge weights. A: The R-distance plotted against the true graph distance. $V=1000$ vertices, $p=0.5$ edge probability, edge weights range from 1 to 100 with log-uniform distribution. $\gamma=1

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.