cityscapelabs / cityscape-archive

City-scale graph-spatial-agent framework
Apache License 2.0
2 stars 1 forks source link

Redesign of framework for layer/graph division/merge support #14

Closed rewu1993 closed 4 years ago

rewu1993 commented 4 years ago

Redesign of framework for layer/graph division/merge support

Summary

Detach connectivity information such as in/out edges from the node. Using adjacency list/matrix to represent the connectivity.

Motivation

Current design is not valid when nodes/edges are used by different graphs/layers. For instance, in/out edges are stored inside the node object, which become invalid if multiple graphs/layers are using the same set of nodes. The shortest path algorithm will not work for some graphs and the only way to do it is to create distinct nodes/edges for each graph. Also, current design does not allow multiple edges between same set of nodes. One spatial point can not represent multiple nodes (can be a house/water pipeline node/road end) too.

Design Detail

Maintain a global layer (invisible to the users). All reachable layers are subset of this layer. Each sublayer maintains its own adjacency matrix/list to represent the graph. In other words, connectivity information goes with each layer instead of the node itself. Merging/Splitting graphs/layers simply means creating new adjacency list from the old one. Node/edge itself can stay intact.The other benefit is that by representing graphs with adjacency list/matrix makes it easier to hook to other graph libraries.

Drawbacks

Rewrite basically everything.

Rationale and Alternatives

See above No rationale, just passion

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.