由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - data structure for set of path in a graph
相关主题
问问Boost library, 尤其是Boost Graph Library (BGL)请教一个gcc include path 的问题
cygwin is not working in the DOS window问题请教
[合集] 问个算法问题perl: how to get the filename from the full path name
[合集] huge map怎么算最短路径?请教一个弱弱问题,关于#include的pathname
python descriptor 问题请教,关于g++ -l的问题
面题:copy directed graph[合集] regular expression for whitespace in path
存储 n 个directed weighted graph进数据库#!/usr/bin/envperl是什么? (转载)
如何绕开/etc/ld.so.conf中的路径,先搜索自己指定的.so路径?问一个link的问题
相关话题的讨论汇总
话题: path话题: vertices话题: v2话题: so话题: paths
进入Programming版参与讨论
1 (共1页)
f**n
发帖数: 401
1
Suppose we have a one-directional graph. Define a path as a sequence of
vertices such that from each of its vertices there is an edge to the next
vertex in the sequence. So a path of three vertices would be recorded
somehow as v1->v2->v3.
Now I need to store a set of paths that are different from each other. For
example, path 1 is v1->v2->v3, path 2 is v2->v3->v4, path 3 is v2->v4, and
so on so forth. I need a container to store path 1, 2, and 3. The number of
paths can be much bigger than the t
X****r
发帖数: 3557
2
If you only need to add and locate *full* paths in your container,
you can simply use vectors of vertices as paths and a hashtable
to store them.

of
?
give

【在 f**n 的大作中提到】
: Suppose we have a one-directional graph. Define a path as a sequence of
: vertices such that from each of its vertices there is an edge to the next
: vertex in the sequence. So a path of three vertices would be recorded
: somehow as v1->v2->v3.
: Now I need to store a set of paths that are different from each other. For
: example, path 1 is v1->v2->v3, path 2 is v2->v3->v4, path 3 is v2->v4, and
: so on so forth. I need a container to store path 1, 2, and 3. The number of
: paths can be much bigger than the t

f**n
发帖数: 401
3
Thank you. It seems doable. But I just wonder if there is any fancier
solution...

【在 X****r 的大作中提到】
: If you only need to add and locate *full* paths in your container,
: you can simply use vectors of vertices as paths and a hashtable
: to store them.
:
: of
: ?
: give

X****r
发帖数: 3557
4
The simplest design that fits your need is the best design.
"A designer knows he has achieved perfection not when there is nothing
left to add, but when there is nothing left to take away."
- Antoine de Saint-Exupry
(quote for Engineering in Civilization IV)

【在 f**n 的大作中提到】
: Thank you. It seems doable. But I just wonder if there is any fancier
: solution...

t****t
发帖数: 6806
5
While i agree that "The simplest design that fits your need is the best
design", but I doubt St. Exupry has any idea about engineering. He's a
writer (and pilot), so called 文科生, no?

【在 X****r 的大作中提到】
: The simplest design that fits your need is the best design.
: "A designer knows he has achieved perfection not when there is nothing
: left to add, but when there is nothing left to take away."
: - Antoine de Saint-Exupry
: (quote for Engineering in Civilization IV)

X****r
发帖数: 3557
6
He was also a pilot, both commerial and in military. So he might not
have had much idea on designing machineries but he should have been
no stranger on evaluating some of them.
Anyway, it's just a civ4 quote :)

【在 t****t 的大作中提到】
: While i agree that "The simplest design that fits your need is the best
: design", but I doubt St. Exupry has any idea about engineering. He's a
: writer (and pilot), so called 文科生, no?

1 (共1页)
进入Programming版参与讨论
相关主题
问一个link的问题python descriptor 问题
Python的一个错误面题:copy directed graph
如何修改linux PATH 以便programming?存储 n 个directed weighted graph进数据库
如果从partial filename 知道PATH?如何绕开/etc/ld.so.conf中的路径,先搜索自己指定的.so路径?
问问Boost library, 尤其是Boost Graph Library (BGL)请教一个gcc include path 的问题
cygwin is not working in the DOS window问题请教
[合集] 问个算法问题perl: how to get the filename from the full path name
[合集] huge map怎么算最短路径?请教一个弱弱问题,关于#include的pathname
相关话题的讨论汇总
话题: path话题: vertices话题: v2话题: so话题: paths