displayStructure property

String displayStructure

Returns a String representation of the graph using the vertex id instead of the vertex data.

Implementation

String get displayStructure {
  var b = StringBuffer();
  b.writeln('{');
  for (var vertex in _vertices.value) {
    b.write(' ${vertex.id}: ');
    b.write('[');
    b.writeAll(_edges[vertex].map<int>((item) => item.id) ?? [], ', ');
    b.write('],');
    b.writeln('');
  }
  b.write('}');
  return b.toString();
}