=str  #16109: Replace ScalaGraph with custom graph impl

Minimalistic replacement for ScalaGraph. Not speed optimized so far, and it only provides a mutable representation (builder) yet.

If immutability is required it can be implemented, will take a little time. I can do it in this PR or we can open a ticket.

As for speed optimizations, if we get rid of the remove operation (we only use it to fuse graphs together) then we keep the following invariants:
 - all connected components remain connected, but they might get connected together
 - all cycles remain cylces

So we will be able to do inremental calculation of these which can be very fast with appropriate data structures.

**No unit tests yet, TBD**
You are commenting without hitting refresh for a while: this PR has been
squashed already (your comment does not show up). There is no immutable
graph yet, so you need to copy if you want to share a graph.

On Tue, Nov 4, 2014 at 3:21 PM, Viktor Klang (√) <notifications@github.com>
wrote:

> In akka-stream/src/main/scala/akka/stream/impl/DirectedGraphBuilder.scala:
>
> > +    case _             ⇒ false
> > +  }
> > +
> > +  override def hashCode(): Int = label.hashCode()
> > +}
> > +
> > +/**
> > + * INTERNAL API
> > + */
> > +private[akka] object DirectedGraphBuilder {
> > +
> > +  /**
> > +   * Performs a deep copy of the builder. Since the builder is mutable it is not safe to share instances of it
> > +   * without making a defensive copy first.
> > +   */
> > +  def copy[E, V](g: DirectedGraphBuilder[E, V]): DirectedGraphBuilder[E, V] = {
>
> When do we need to copy the builders?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/akka/akka/pull/16193/files#r19804425>.
>