graph-algorithm

Polygon from a grid of squares

萝らか妹 提交于 2021-01-27 06:39:39
问题 I'm looking for an algorithm to find the polygon that surrounds a contiguous grid of squares without holes as shown here: . I already have each of the grid squares storing data about the kind of edges with the surrounding area that they are composed of (i.e. top, top-right, top-bottom, no edges, etc.), so I'm thinking that this data could be utilized by the algorithm. If someone could provide some pseudocode for such an algorithm that would also be great. The input to the algorithm would be a

Polygon from a grid of squares

烈酒焚心 提交于 2021-01-27 06:38:30
问题 I'm looking for an algorithm to find the polygon that surrounds a contiguous grid of squares without holes as shown here: . I already have each of the grid squares storing data about the kind of edges with the surrounding area that they are composed of (i.e. top, top-right, top-bottom, no edges, etc.), so I'm thinking that this data could be utilized by the algorithm. If someone could provide some pseudocode for such an algorithm that would also be great. The input to the algorithm would be a

Find nearest edge in graph

跟風遠走 提交于 2021-01-20 16:35:19
问题 I want to find the nearest edge in a graph. Consider the following example: Figure 1: yellow: vertices, black: edges, blue: query-point General Information: The graph contains about 10million vertices and about 15million edges . Every vertex has coordinates. Edges are defined by the two adjacent vertices. Simplest solution: I could simply calculate the distance from the query-point to every other edge in the graph, but that would be horribly slow. Idea and difficulties: My idea was to use

Find nearest edge in graph

女生的网名这么多〃 提交于 2021-01-20 16:31:13
问题 I want to find the nearest edge in a graph. Consider the following example: Figure 1: yellow: vertices, black: edges, blue: query-point General Information: The graph contains about 10million vertices and about 15million edges . Every vertex has coordinates. Edges are defined by the two adjacent vertices. Simplest solution: I could simply calculate the distance from the query-point to every other edge in the graph, but that would be horribly slow. Idea and difficulties: My idea was to use

Find nearest edge in graph

本小妞迷上赌 提交于 2021-01-20 16:30:57
问题 I want to find the nearest edge in a graph. Consider the following example: Figure 1: yellow: vertices, black: edges, blue: query-point General Information: The graph contains about 10million vertices and about 15million edges . Every vertex has coordinates. Edges are defined by the two adjacent vertices. Simplest solution: I could simply calculate the distance from the query-point to every other edge in the graph, but that would be horribly slow. Idea and difficulties: My idea was to use