百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

transit-map

> 开发工具
开源

使用混合整数规划生成给定(公交)网络图的示意图(“地铁图”)。

200 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

使用混合整数规划生成给定(公交)网络图的示意图(“地铁图”)。

transit-map

Generate a schematic map (“metro map”) for a given (transit) network graph using a Mixed Integer Programming approach. Part of the Generating Transit Maps project.

Work in progress, DO NOT USE THIS IN PRODUCTION! See todo.

  • Installation & Requirements
  • Usage
  • Examples
  • To do
  • Contributing

Installation & Requirements

Sadly, for now, you need a valid copy of the commercial Gurobi solver (free academic licenses) in order to run this project. In the near future however, this project will hopefully also support the open CBC solver. Stay tuned.

What you need:

  • node.js 8.0 or higher installed
  • gurobi_cl 7.5 or higher in your $PATH

Then, to install the package (for CLI usage), simply run:

bash
npm install -g transit-map

Usage

CLI

You need a JSON graph representation of your transit network that looks like this example for the Berlin Metro (U-Bahn). You can then generate a transit map for the given graph by running:

bash
cat graph.json | transit-map > output.svg

For further information on several CLI options/params, run:

bash
transit-map --help

As a library

The module can be used as a JS library, documentation for this will follow.

Examples

Berlin (Metro)

Input

Output

Using this input graph. Running time ≈40sec.

Vienna (Metro)

Input

Output

Using this input graph. Running time ≈20sec.

Stockholm (Metro)

Input

Output

Using this input graph. Running time ≈20sec.

Lisbon (Metro)

Input

Output

Using this input graph. Running time ≈15sec.

Nantes (Tram)

Input

Output

Using this input graph. Running time ≈15sec.

Montpellier (Tram)

Input

Output

Using this input graph. Running time ≈20sec.

To do

Things I am still working on or someone should work on in the future, roughly in order of perceived importance:

  1. Properly document the current optimization algorithm.
  2. Add an example for full Berlin network (S-Bahn & U-Bahn), debug pre-processing with this (still fails with this network for some reason).
  3. Resolve todo comments in code.
  4. Write tests.
  5. Improve algorithm: “Smoother” edges, higher distance for parallel lines, implement station labels.
  6. Linearize objective function which would allow users to use non-commercial solvers like Cbc.
  7. Enable users to provide an old layout of the same network (or parts of it), the newly generated network should then have as few differences as possible to the older one.
  8. Further explore heuristical approaches to this problem.
  9. Write a paper.

Contributing

If you found a bug or want to propose a feature, feel free to visit the issues page.

Issues· 7 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptclilibrarypublic-transport

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具