CGraph
Enrichment pending【A common used C++ & Python DAG framework】 一个通用的、无三方依赖的、跨平台的、收录于awesome-cpp的、基于流图的并行计算框架。欢迎star & fork & 交流
GraphCanon updated today · GitHub synced today
Verify the decision
Maintenance and security
Full trust report- Maintenance
- Active (10d since push)
- As of today
- Provenance
- Not a fork · Personal account
- As of today
- Security (OSV)
- No lockfile
- As of today
Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.
Install
git clone https://github.com/ChunelFeng/CGraphSimilar tools
Same-category neighbours. No typed graph edges are catalogued for this tool yet.
Evidence and technical details
Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.
Overview
【A common used C++ & Python DAG framework】 一个通用的、无三方依赖的、跨平台的、收录于awesome-cpp的、基于流图的并行计算框架。欢迎star & fork & 交流
Capability facts
- Languages
- c++
Source: github.language · Jul 15, 2026
Categories
Compatibility
Sourced claims from the README excerpt - not unsourced marketing copy.
Source: README excerpt (regex_v1, Jul 15, 2026)
ps://github.com/ChunelFeng/CGraph"><img src="https://badgen.net/badge/langs/C++,Python/cyan?list=1" alt="languages"></a>Source link
Tags
README
中文 | English Readme | deepwiki
CGraph 说明文档
CGraph is a cross-platform Directed Acyclic Graph framework based on pure C++ without any 3rd-party dependencies.
You, with it, can build your own operators simply, and describe any running schedules as you need, such as dependence, parallelling, aggregation, conditional and so on. Python APIs are also supported to build your pipeline.
Tutorials and contact information are shown as follows. Please get in touch with us for free if you need more about this repository.
一. 简介
CGraph中文名为【色丶图】,是一套无任何第三方依赖的跨平台图流程执行框架。通过GPipeline(流水线)底层调度,提供了包含依赖元素依次执行、非依赖元素并发执行,支持暂停、恢复、超时设定的 eDAG 调度功能。
使用者只需继承GNode(节点)类,实现子类的run()方法,并根据需要设定依赖关系,即可实现任务的图化执行或流水线执行。还可以通过设定各种包含多节点信息的GGroup(组),自行控制图的条件判断、循环和并发执行逻辑。
本工程使用纯C++11标准库编写,无任何第三方依赖,兼容MacOS、Linux、Windows和Android系统。支持本地编译和二次开发,并且提供Python版本:pycgraph。编译和安装方法,请参考 CGraph 编译说明
详细功能介绍和用法,请参考 一面之猿网 中的文章内容。相关视频在B站持续更新中,欢迎观看和交流:
- 【B站视频】CGraph 入门篇
- 【B站视频】CGraph 功能篇
- 全面介绍CGraph项目中,所有的名词术语和功能模块
- 结合实际coding过程,详细介绍了每个功能的具体的使用场景、用法、以及解决的问题
- 适合想要全面了解功能和快速上手使用CGraph的童鞋
- 适合对多线程编程感兴趣的童鞋
- 【B站视频】CGraph 应用篇
- 【B站视频】CGraph 分享篇
二. 入门Demo
C++ 版本
#include "CGraph.h"
using namespace CGraph;
class MyNode1 : public GNode {
public:
CStatus run() override {
printf("[%s], sleep for 1 second ...\n", this->getName().c_str());
CGRAPH_SLEEP_SECOND(1)
return CStatus();
}
};
class MyNode2 : public GNode {
public:
CStatus run() override {
printf("[%s], sleep for 2 second ...\n", this->getName().c_str());
CGRAPH_SLEEP_SECOND(2)
return CStatus();
}
};
int main() {
/* 创建一个流水线,用于设定和执行流图信息 */
GPipelinePtr pipeline = GPipelineFactory::create();
GElementPtr a, b, c, d = nullptr;
/* 注册节点之间的依赖关系 */
pipeline->registerGElement<MyNode1>(&a, {}, "nodeA");
pipeline->registerGElement<MyNode2>(&b, {a}, "nodeB");
pipeline->registerGElement<MyNode1>(&c, {a}, "nodeC");
pipeline->registerGElement<MyNode2>(&d, {b, c}, "nodeD");
/* 执行流图框架 */
pipeline->process();
/* 清空流水线中所有的资源 */
GPipelineFactory::remove(pipeline);
return 0;
}
如上图所示,图结构执行的时候,首先执行`a`节点。`a`节点执行完毕后,并行执行`b`和`c`节点。`b`和`c`节点全部执行完毕后,再执行`d`节点。
Python
For agents
This page has a .md twin and JSON over the API.