| Crates.io | cyclic_graph |
| lib.rs | cyclic_graph |
| version | 0.2.1 |
| created_at | 2025-04-08 03:56:45.414033+00 |
| updated_at | 2025-09-25 09:47:24.086972+00 |
| description | This package provides a way to use a structure that implements a cyclic directed graph with a single input and single output. It is designed to be used asynchronously. |
| homepage | https://github.com/greyshaman/cyclic_graph |
| repository | https://github.com/greyshaman/cyclic_graph |
| max_upload_size | |
| id | 1624959 |
| size | 5,013,159 |

A Rust library that implements a directed cyclic graph with one input and one output.
Add the dependency to your Cargo.toml:
[dependencies]
cyclic_graph = "0.2.1"
The idea of creating this library is to provide convenient placement of layers containing interacting neurons within a neuromorphic system. This system assumes a network with one input layer, many hidden layers, and one output layer.
In this network, signals are propagated and processed in a certain direction — from the input layer to the output layer through hidden ones. There may be cyclical connections between hidden layers.
The system structure should be flexible and dynamically changeable. It should allow you to delete, add, and organize connections between layers, as well as provide access to layers and their payloads.
It is proposed to represent the layers as nodes of a graph and operate on them as with nodes of this graph.
Also cyclic graph can playing role as graph storage to keep primitive (simple) data types in nodes.
In the initial state, the graph has only input and output nodes that are connected. These nodes cannot be removed or moved. The input node is always the starting point for other nodes in the graph, and the output is always an ending point for other nodes. Nodes can be added between already existing nodes. Connections are cut at the point of insertion and closed to the added node. Nodes can also be placed between existing nodes without altering existing connections. When a new node is inserted or added, its identifier is generated using a function specified during graph creation. If a node is removed (except for the input or output), connections must continue to the remaining nodes.
Contributions are welcome! If you'd like to contribute, please follow these steps:
This project is licensed under the MIT License.