Converts this edge to a JSON representation.
The returned map must include at least 'from', 'to', and 'weight' keys.
Map<String, dynamic> toJson();