소스 검색

include initial verticies in solution list

pull/16/head
Tristan Sloughter 10 년 전
부모
커밋
eb5c0eb424
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. +4
    -3
      src/rebar_digraph.erl

+ 4
- 3
src/rebar_digraph.erl 파일 보기

@ -18,7 +18,9 @@ restore_graph({Vs, Es}) ->
Graph.
solve(Graph, Vertices) ->
solve(Graph, Vertices, dict:new()).
solve(Graph, Vertices, lists:foldl(fun({Key, _}=N, Solution) ->
dict:store(Key, N, Solution)
end, dict:new(), Vertices)).
solve(_Graph, [], Solution) ->
{_, Vertices} = lists:unzip(dict:to_list(Solution)),
@ -28,8 +30,7 @@ solve(Graph, Vertices, Solution) ->
lists:foldl(fun(V, {NewVertices, SolutionAcc}) ->
OutNeighbors = digraph:out_neighbours(Graph, V),
lists:foldl(fun({Key, _}=N, {NewVertices1, SolutionAcc1}) ->
case dict:is_key(Key, SolutionAcc1) orelse
lists:keymember(Key, 1, Vertices) of
case dict:is_key(Key, SolutionAcc1) of
true ->
{NewVertices1, SolutionAcc1};
false ->

불러오는 중...
취소
저장