(by Dachuan)
LeafVein is a graph theory plug-in for Grasshopper.  You can generate graphs from Rhino/GH geometric objects and perform multiple graph algorithms.
Support Email

LeafVein is a graph theory plug-in for Grasshopper. The design goal of LeafVein is to use Rhino/GH geometric objects to easily generate abstract and complex network graph objects and provide as many graph-related algorithms as possible. With LeafVein, you can use the curves, points and meshs in Rhino/Grasshopper to generate undirected, directed or mixed graphs; based on the provided arcs option generator, you can specify the properties (direction and weight) of each arc; provide a wealth of graph analysis, path search and neighbor search algorithm. LeafVein is developed with Python, but the bottom layer uses Satsuma and Alglib high-performance math libraries. It can perform operations on large-scale complex graphs (tens of thousands of nodes and arcs) in a reasonable time. Graph theory is widely used in urban planning, architectural design (space syntax), etc. This plug-in can help you save time and improve efficiency in related research.

LeafVein mainly has the following features:

1 Create graphs in a variety of ways, and completely customize graph properties.

  • Mixed graphs with directed and undirected edges.
  • Create custom graphs, complete graphs, and bipartite graphs through Rhino or Grasshopper curves, points or mesh objects (Objects can be located in three-dimensional space).
  • Set the direction and cost of each arc through global attributes or custom attributes (Rhino object user attributes or Json parameters).

2 Visualization tool: node number, arc number, arc length, custom the size and color of text and graphic.

3 Easily transform/search between Rhino/GH objects and graph elements: locate the arcs and nodes of the graph according to curves and points, and display the corresponding curves and points according to the arcs and nodes of the graph.

4 The graph can be edited after created: adjust the established graph by adding, deleting arcs and nodes, and changing the direction of the arcs.

5 Multiple graph-related algorithms: Bipartite graph conversion, Bipartite graph Matching (maximum matching, minimum cost and maximum matching), Minimum spanning tree, strong and weak connected components, cut points/edges of the graph, Topological order, neighbor search (Kd-tree).

6 Rich path algorithms: Breadth-first, Depth-first, Shortest path (Dijkstra and Astar), Single source shortest path, Euler path, Hamilton path, heuristic Traveling salesman solver.

It is currently an alpha version, and leafvein is under active development. Any comments/bug feedback you can contacted: i@alwayswdc.com



1 多种方式建立图,并完全自定义图的属性。

  • 边有向和无向的混合图。
  • 通过Rhino或Grasshopper曲线、点或网格对象建立自定义图、完全图、二分图(对象可位于三维空间)。
  • 通过全局属性或自定义属性(Rhino对象用户属性或Json参数)设置边的方向、长度。

2 可视化图:节点编号、弧编号、弧长度、自定义文字和图形大小和颜色。

3 轻松转化Rhino/GH对象和图的元素:根据曲线、点定位图的弧、节点,根据图的弧和节点显示相应的曲线和点。

4 图可编辑:通过添加、删除弧和节点,改变弧的方向来调整已建立的图。

5 多种图相关算法:二分图转换、二分图匹配(最大匹配、最小费用最大匹配)、最小生成树、图的强弱连通分量、图的割点/边、拓扑排序、邻近点搜索(Kd-tree)。

6 丰富的路径算法:广度优先、深度优先、最短路径(Dijkstra和Astar)、单源最短路径、欧拉路径、汉密尔顿路径、启发式旅行商求解器。



1 Bug fixed:

  • Fixed context pop-up menu option cannot be saved

  • Fixed an error when SuperGraph input Opt

  • Fixed errors of GetOpt

2 Examples updated.