graph-theory

Algorithm for finding smallest collection of components

让人想犯罪 __ 提交于 2019-12-21 04:21:33
问题 I'm looking for an algorithm to solve the following problem. I have a number of subsets (1-n) of a given set (a-h). I want to find the smallest collection of subsets that will allow me to construct, by combination, all of the given subsets. This collection can contain subsets that do not exist in 1-n yet. a b c d e f g h 1 1 2 1 1 3 1 1 1 4 1 1 5 1 1 6 1 1 1 1 7 1 1 1 1 8 1 1 1 9 1 1 1 Below are two possible collections, the smallest of which contains seven subsets. I have denoted new subsets

crossing edges in the travelling salesman problem

末鹿安然 提交于 2019-12-21 03:44:27
问题 Does there exist a travelling salesman problem where the optimal solution has edges that cross? The nodes are in an x-y plane, so crossing in this case means if you were to draw the graph, two line segments connecting four separate nodes would intersect. 回答1: If two edges in a closed polygonal line cross, then there is a polygonal line with the same vertices but with smaller perimeter. This is a consequence of the triangle inequality. So, a solution to the TSP must be a simple polygon. See

Is there a better database than Git (with serializable, immutable, versioned trees)?

非 Y 不嫁゛ 提交于 2019-12-20 19:43:27
问题 Imagine the data structure behind Git. It's like a confluently persistent data structure, except using hash references instead of traditional pointers. I need Git's data structure, except without any of the working tree and index stuff. And there would be millions of branches, each tracking a handful of other local branches. Commits and merges would occur several thousand times per minute on different threads. Pulls would occur every second. Between libgit2 and jgit I can use Git's data

how to find Connected Component dynamically

大兔子大兔子 提交于 2019-12-20 11:55:13
问题 Using disjoint-set data structure can easily get connected component of Graph. And, it just supports Incremental Connected Components. However, in my case, removing edge is very common so that I am looking for an algorithm or new structure can maintain Connected Components fully dynamically (including adding and removing edge) Thanks 回答1: Poly-logarithmic deterministic fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and biconnectivity (Holm, de Lichtenberg and Thorup

Shortest two disjoint paths; two sources and two destinations

心已入冬 提交于 2019-12-20 11:34:04
问题 We're given an unweighted undirected graph G = (V, E) where |V| <= 40,000 and |E| <= 10 6 . We're also given four vertices a, b, a', b' . Is there a way to find two node-disjoint paths a -> a' and b -> b' such that the sum of their lengths is minimum? My first thought was to first find the shortest path a -> a' , delete it from the graph, and then find the shortest path b -> b' . I don't think this greedy approach would work. Note: Throughout the application, a and b are fixed, while a' and b

Graph library for Cocoa [closed]

我与影子孤独终老i 提交于 2019-12-20 10:53:07
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Is there any good library for some graph-app? I want to create nodes, add weighted edges, etc… EDIT I need a graph (like on the image

Where can I learn more about “ant colony” optimizations?

安稳与你 提交于 2019-12-20 10:44:32
问题 I've been reading things here and there for a while now about using an "ant colony" model as a heuristic approach to optimizing various types of algorithms. However, I have yet to find an article or book that discusses ant colony optimizations in an introductory manner, or even in a lot of detail. Can anyone point me at some resources where I can learn more about this idea? 回答1: On the off chance that you know German (yes, sorry …), a friend and I have written an introduction with code about

Is there any graph data structure implemented for C#

扶醉桌前 提交于 2019-12-20 08:59:11
问题 I tried to find a graph data structure to reuse in C# without any success. Of course, I can borrow from data structure books but I want it to be more commercially practical(?) Also I would appreciate if you can tell me what the best way of implementing a graph is. Thanks 回答1: QuickGraph QuickGraph is a graph library for .NET that is inspired by Boost Graph Library. QuickGraph provides generic directed/undirected graph datastructures and algorithms for .Net 2.0 and up. QuickGraph comes with

Find all simple path from node A to node B in direct weighted graph with the sum of weighs less a certain value?

戏子无情 提交于 2019-12-19 11:52:38
问题 I have a directed weighted graph G=(V,E), which may have loops . I am trying to determine the best time efficient algorithm to accomplish task: t o find all simple path in G between source and target node with total weight of edges in this path less than certain value (for convenience we denote this value as PATH_WEIGHT_LIMIT) All weights is positive and can be float. So, a prototype of my function will be: def find_paths(G, source, target, path_weight_limit) Result paths may overlap, its

How do I find all polygons in an undirected graph?

若如初见. 提交于 2019-12-19 10:45:11
问题 Given an undirected graph, what would be an algorithm to find all polygons within such graph? Here is an example graph with polygons in colour. Note that there is a polygon ABCIHGJKLMLKA, which includes the nodes KLM, but the polygon CDEG does not include F. I have read of solutions to this problem, but without the leaf requirement that I have. Some axioms that exist in previous solutions is that each edge is only used twice, however dead-end edges would need to be traversed four times in