Open
Conversation
odanado
requested changes
Mar 31, 2018
lib/Graph/dijkstra.cpp
Outdated
| Dijkstra(int n, bool dir); | ||
| vector<long long> cost; | ||
| vector<int> prever; | ||
| void add_edge(int f, int t, long long c); |
lib/Graph/dijkstra.cpp
Outdated
| vector<long long> cost; | ||
| vector<int> prever; | ||
| void add_edge(int f, int t, long long c); | ||
| bool has_path(int t); // tに至るパスはあるか |
lib/Graph/dijkstra.cpp
Outdated
| vector<int> prever; | ||
| void add_edge(int f, int t, long long c); | ||
| bool has_path(int t); // tに至るパスはあるか | ||
| vector<int> get_shortest_path(int t); |
lib/Graph/dijkstra.cpp
Outdated
| void add_edge(int f, int t, long long c); | ||
| bool has_path(int t); // tに至るパスはあるか | ||
| vector<int> get_shortest_path(int t); | ||
| void run(int f); |
lib/Graph/dijkstra.cpp
Outdated
| private: | ||
| bool is_dir = false; // 無向グラフ: false, 有向グラフ: true | ||
| long long INFl = (long long)1e15; | ||
| int array_size_of_cost; |
lib/Graph/dijkstra.cpp
Outdated
| #include "template.h" | ||
|
|
||
| struct Edge { | ||
| long long cost; |
lib/Graph/dijkstra.cpp
Outdated
| struct Edge { | ||
| long long cost; | ||
| int to; | ||
| Edge(int t, long long c) { |
lib/Graph/dijkstra.cpp
Outdated
| class Dijkstra { | ||
| private: | ||
| bool is_dir = false; // 無向グラフ: false, 有向グラフ: true | ||
| long long INFl = (long long)1e15; |
Contributor
Author
|
commitID:a37f441の時 Run関数内でfirst_state, sum_cost, current_stateという変数を宣言しているがテストに通っています |
Member
|
cpplintは変数名の形式をチェックしません |
Contributor
Author
|
なるほど.目で確認するしかないのですね… |
Member
|
ググったら正規表現でチェックするツールが有りました |
Contributor
Author
|
long long をIntにするの,人によってかなり変わる気がするのでlong longでも良いとは思うのですが,どうなのでしょう |
Member
|
全部long longということ? |
Contributor
Author
|
そうです.long longであれば誰であれ実行できると思うので |
Member
|
#10 の dinicと構造体Edgeの構造が異なるのが気になります(templateと非templateの違い) |
Contributor
Author
|
構造体Edgeは別でプルリクを出しておきます. |
odanado
reviewed
Apr 29, 2018
lib/Graph/dijkstra.h
Outdated
| }; | ||
|
|
||
| template <typename T> | ||
| Dijkstra<T>::Dijkstra(int n, bool dir) |
Member
There was a problem hiding this comment.
他のグラフアルゴリズムのクラスでは、基本的に有向グラフを構築する仕様になっています
ダイクストラだけコンストラクタで、有向グラフかどうかを指定するのは違和感があります
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dijkstraクラスを作ってたものをプルリク送りました.改善点あれば修正します.