FindPath
例題
すべて開く すべて閉じる例 (2)
g = [image];FindPath[g, 3, 2]HighlightGraph[g, PathGraph[First[%]]]g = ExampleData[{"NetworkGraph", "Friendship"}];FindPath[g, "Anna", "Larry", Infinity, All]スコープ (12)
指定 (7)
FindPathは無向グラフに使うことができる:
FindPath[[image], 2, 7]FindPath[[image], 2, 12]FindPath[[image], 2, 7]FindPath[[image], 2, 7]FindPath[[image], 2, 4]FindPath[{1 -> 2, 1 -> 4, 2 -> 3, 2 -> 5, 3 -> 6, 4 -> 5, 4 -> 7, 5 -> 6, 5 -> 8, 6 -> 9, 7 -> 8, 7 -> 10, 8 -> 9, 8 -> 11, 9 -> 12, 10 -> 11, 11 -> 12}, 2, 12]FindPathは大きいグラフに使うことができる:
g = GridGraph[{10, 10, 10, 10}];FindPath[g, 1, 10000]//Short//Timing一覧 (5)
FindPath[[image], 1, 12, {7}]FindPath[[image], 1, 12, 6]FindPath[[image], 1, 12, {5, 7}]FindPath[[image], 1, 12, Infinity, All]//ShortFindPathは,経路がない場合は空リストを与える:
FindPath[[image], 1, 12]アプリケーション (2)
サッカーボールの縫い目に沿って,長さが最高で5の経路を求める:
g = PolyhedronData["SoccerBall", "Skeleton"];path = FindPath[g, 19, 30, 6, All]coords = PolyhedronData["SoccerBall", "Vertices"];Graphics3D[Join[{Glow[Gray], PolyhedronData["SoccerBall", "GraphicsComplex"], Red}, Sphere[#, 0.3]& /@ coords[[{19, 30}]], {Red, Tube[coords[[#]], 0.2]}]]& /@ pathg = \!\(\*GraphicsBox[«4»]\);ArsenalからAlpertonまで,最高で16ヶ所に停車する外出経路を求める:
FindPath[g, "Arsenal", "Alperton", 17, All]特性と関係 (2)
s = 1;
t = 12;
g = GridGraph[{3, 4}, VertexSize -> {s -> Medium, t -> Medium}]FindPath[g, s, t, {GraphDistance[g, s, t]}, All]HighlightGraph[g, PathGraph[#]]& /@ %FindPathは単純経路しか返さない:
FindPath[[image], 1, 3, Infinity, All]テキスト
Wolfram Research (2014), FindPath, Wolfram言語関数, https://reference.wolfram.com/language/ref/FindPath.html (2015年に更新).
CMS
Wolfram Language. 2014. "FindPath." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/FindPath.html.
APA
Wolfram Language. (2014). FindPath. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindPath.html
BibTeX
@misc{reference.wolfram_2026_findpath, author="Wolfram Research", title="{FindPath}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/FindPath.html}", note=[Accessed: 07-October-2026]}
BibLaTeX
@online{reference.wolfram_2026_findpath, organization={Wolfram Research}, title={FindPath}, year={2015}, url={https://reference.wolfram.com/language/ref/FindPath.html}, note=[Accessed: 07-October-2026]}