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

In the fields of architecture and urban planning, graph theory has become an essential basic mathematical tool for quantitative research in many research directions (such as path optimization, facility distribution, spatial syntax, etc.). LeafVein is a general graph theory simulation tool on Grasshopper(GH) platform. The design goal of LeafVein is to use geometric objects in Rhino/GH to easily create abstract graph object instead of traditional code-based graph creation methods, and to provide as perfect algorithms as possible in the graph theory field. So as to help any Rhino/GH users easily analyze research problems associate with graph theory. You can create directed, undirected or mixed graphs in many ways by using LeafVein, and set properties (direction and weight/distance) for each graph arc/edge individually by a sequence or object’s properties. LeafVein has rich graph correlation analysis, path calculation and proximal point algorithms to meet the needs of different problems. LeafVein has high performance and can support the creation and calculation of large-scale complex graphs (more than 100,000 nodes or arcs/Edge). Compare with expensive GIS software or complicated code tool, using LeafVein can help you save time/cost 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 arcs or undirected edges.
  • Create custom graphs, complete graphs, and bipartite graphs through Rhino /GH curves, points or grid objects (Objects can be located in three-dimensional space).;Prase Openstreetmap open source map (online or offline .osm files) routes into graph (The latitude and longitude coordinate conversion is the same as ELK and can be used together with it.).
  • 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 A variety of  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) , etc., and provide a variety of parameter options.

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 , etc., and provide a variety of parameter options.

The LeafVein can be downloaded from https://www.food4rhino.com/en/app/leafvein and supports Rhino 6 and Rhino 7 on windows. The use of LeafVein must comply with LGPL protocol (signed, commercially available, modifiable, but the modified or derivative version based on LeafVein cannot be sold). It is currently an alpha version, you can contact i@alwayswdc.com for any comments /bug feedback.



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

  • 使用Rhino或GH曲线、点、网格(对象可位于三维空间)建立自定义图、完全图或二分图;使用Openstreetmap开源地图在线或离线文件创建城市路径网络图;
  • 通过全局设置图的有向性或无向性,边按几何对象长度设置权重或等权;
  • 通过自定义属性运算器(json列表或rhino对象的用户属性参数)设置每条弧的方向与权重(距离)。

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

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

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

5 多种图相关分析算法:图/弧/节点的属性、二分图转换、二分图匹配(最大匹配、最小费用最大匹配)、最小生成树、图的强弱连通分量、图的割点/边、拓扑排序、邻近点搜索(Kd-tree)等,并提供多种参数选项。

6 丰富的路径算法:广度优先搜索、深度优先搜索、最短路径(Dijkstra和Astar)、单源最短路径、欧拉路径、汉密尔顿路径、启发式旅行商求解器等,并提供多种参数选项。

LeafVein可从https://www.food4rhino.com/en/app/leafvein下载,支持windows版Rhino 6和Rhino 7,使用LeafVein需遵循LGPL协议(署名、可商用、可修改、但不可出售基于LeafVein的修改或衍生版本)。当前仍处于早期的Aplha版,任何意见/bug反馈可以联系:i@alwayswdc.com。


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.


1 New New graph creator components:

  • OSMGraph:parse .osm into graph.

  • ONLMapGraph:creat graph from online openstreetmap.

2 Some bugs fixed.

3 Examples updated.


Fixed a bug of Euler path component.

License Cost: