looking for a data structure that support relation m-m between two concepts -


i looking data structure model following relations between 2 concepts type , entity. number of entity , type more 100 million.

enter image description here

the direction of arrow show need access type entity , reverse.

i looking n efficient data structure; otherwise implemented 2 maps:

(type,entities) , (entity, types)

you can use bipartite graph model type of data adjacency list representation.

you want efficient data structure, type of operations need perform on data?

see this operations , time complexities.

for adjacency list implementation, nodes can represented in array. node name->index number mapping can stored lookup table. reference here .


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -