Best Way to Store/Access a Directed Graph

后端 未结 6 626
清酒与你
清酒与你 2021-02-01 09:14

I have around 3500 flood control facilities that I would like to represent as a network to determine flow paths (essentially a directed graph). I\'m currently using SqlServer an

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-01 09:52

    My experiences with storing something like you described in a SQL Server database:

    I was storing a distance matrix, telling how long does it take to travel from point A to point B. I have done the naive representation and stored them directly into a table called distances with columns A,B,distance,time.

    This is very slow on simple retreival. I found it is lot better to store my whole matrix as text. Then retreive it into memory before the computations, create an matrix struxture in memory and work with it there.

    I could provide with some code, but it would be C#.

提交回复
热议问题