Text this: Partitioning technique for transformation of connected graphs into single-row networks