Code Monkey home page Code Monkey logo

algorithms's People

Contributors

massakai avatar

Watchers

 avatar  avatar

algorithms's Issues

ダイクストラ法1

ダイクストラ法を用いて最短経路問題を解く。
グラフは隣接行列で表現する。

問題

町の数 n
道の本数 m
出発 s
到着 g
道の始点 i
道の終点 j
距離 c

n m
s g
i0 j0 c0
i1 j1 c1
...
in jn cn

5 10
0 3
0 1 10
0 2 5
1 2 2
1 3 1
2 1 3
2 3 9
2 4 2
3 4 4
4 0 7
4 3 6
6 18
0 4
0 1 5
0 2 4
0 3 2
1 0 5
1 2 2
1 4 6
2 0 4
2 1 2
2 3 3
2 5 2
3 0 2
3 2 3
3 5 6
4 1 6
4 5 4
5 2 2
5 3 6
5 4 4
0 0

ダイクストラ法2

ダイクストラ法を用いて最短経路問題を解く。
グラフは隣接リストで表現する。

問題

町の数 n
道の本数 m
出発 s
到着 g
道の始点 i
道の終点 j
距離 c

n m
s g
i0 j0 c0
i1 j1 c1
...
in jn cn

5 10
0 3
0 1 10
0 2 5
1 2 2
1 3 1
2 1 3
2 3 9
2 4 2
3 4 4
4 0 7
4 3 6
6 18
0 4
0 1 5
0 2 4
0 3 2
1 0 5
1 2 2
1 4 6
2 0 4
2 1 2
2 3 3
2 5 2
3 0 2
3 2 3
3 5 6
4 1 6
4 5 4
5 2 2
5 3 6
5 4 4
0 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.