anchor.diff:  
   maybe_unnecessary(G, V) ->
       digraph:in_degree(G, V) =:= 1.
  +
  +%% @doc Replace the Pid in the optimized map if the old one was restarted.
  +%%
  +%%      Removed vertices hold a reference to the Id (hash) of the process
  +%%      that connects the endpoints of the path that was contracted.
  +%%
  +%%      If this process is restarted, we have to update the pid in the
  +%%      optimized map, otherwise vertices will hold an old reference.
  +%%
  +-spec replace_if_restarted(optimized_map(), pid_table(), pid(),
  +                           process_args()) -> {optimized_map(), pid_table()}.
  +
  +replace_if_restarted(OptMap, PidTable, Pid, ProcessArgs) ->
  +    Id = process_hash(ProcessArgs),
  +    case dict:find(Id, OptMap) of
  +        error -> {OptMap, PidTable};
  +        {ok, {_, VSeq, Metadata}} ->
  +          {dict:store(Id, {Pid, VSeq, Metadata}, OptMap), dict:store(Pid, Id, PidTable)}
  +    end.
   
   %% @doc Perform path contraction in the given sequence of vertices.
   %%
  
positive.code:                          function(),
                           {lasp_vertex(), function()}}.
  
  -record(vertex_label, {pointer_pid :: pid()}).
  
  -type lasp_vertex() :: id() | pid().
  
  
negative.code:         %% Uncontracted -> Contracted forms a loop if there exists a path
          %% from the source of the child to the parent, or the source is
          %% the parent.
          {[], {true, Id}} ->
  
              Tail = get_process_tail(Id, OptMap),
  
              lists:any(fun(V) ->
                  not (digraph:get_path(G, Tail, V) =:= false)
  