Download the PHP package graphp/trivial-graph-format without Composer
On this page you can find all versions of the php package graphp/trivial-graph-format. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download graphp/trivial-graph-format
More information about graphp/trivial-graph-format
Files in graphp/trivial-graph-format
Package trivial-graph-format
Short Description Trivial Graph Format (TGF) is a simple text-based file format for describing graphs
License MIT
Homepage https://github.com/graphp/trivial-graph-format
Informations about the package trivial-graph-format
graphp/trivial-graph-format
Trivial Graph Format (TGF) is a simple text-based file format for describing graphs.
Note: This project is in beta stage! Feel free to report any issues you encounter.
Table of contents
- Usage
- TrivialGraphFormat
- getOutput()
- Install
- Tests
- License
Usage
TrivialGraphFormat
getOutput()
The getOutput(Graph $graph): string
method can be used to
export the given graph instance.
The TGF output will look something like this:
This method only supports exporting the basic graph structure, with all vertices and directed and undirected edges.
Note that TGF does not support the notion of directed and undirected edges. As such, this method will print two edges in opposite directions for any undirected edges.
Note that TGF does not support the notion of structured attributes. As such, this method will print the mathematical attributes as vertex and edge labels as appropriate.
Install
The recommended way to install this library is through composer. New to composer?
This project aims to run on any platform and thus does not require any PHP extensions and supports running on legacy PHP 5.3 through current PHP 7+ and HHVM. It's highly recommended to use PHP 7+ for this project.
Tests
To run the test suite, you first need to clone this repo and then install all dependencies through Composer:
To run the test suite, go to the project root and run:
License
Released under the terms of the permissive MIT license.