  We propose a theoretical framework that generalizes simple and fast
algorithms for hierarchical agglomerative clustering to weighted graphs with
both attractive and repulsive interactions between the nodes. This framework
defines GASP, a Generalized Algorithm for Signed graph Partitioning, and allows
us to explore many combinations of different linkage criteria and cannot-link
constraints. We prove the equivalence of existing clustering methods to some of
those combinations and introduce new algorithms for combinations that have not
been studied before. We study both theoretical and empirical properties of
these combinations and prove that some of these define an ultrametric on the
graph. We conduct a systematic comparison of various instantiations of GASP on
a large variety of both synthetic and existing signed clustering problems, in
terms of accuracy but also efficiency and robustness to noise. Lastly, we show
that some of the algorithms included in our framework, when combined with the
predictions from a CNN model, result in a simple bottom-up instance
segmentation pipeline. Going all the way from pixels to final segments with a
simple procedure, we achieve state-of-the-art accuracy on the CREMI 2016 EM
segmentation benchmark without requiring domain-specific superpixels.
