2017 © Pedro PelĂĄez
 

library trivial-graph-format

Trivial Graph Format (TGF) is a simple text-based file format for describing graphs

image

graphp/trivial-graph-format

Trivial Graph Format (TGF) is a simple text-based file format for describing graphs

  • Sunday, March 8, 2015
  • by clue
  • Repository
  • 2 Watchers
  • 3 Stars
  • 74 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 6 % Grown

The README.md

graphp/trivial-graph-format

CI status, (*1)

Trivial Graph Format (TGF) is a simple text-based file format for describing graphs., (*2)

Note: This project is in beta stage! Feel free to report any issues you encounter., (*3)

Table of contents, (*4)

Usage

TrivialGraphFormat

getOutput()

The getOutput(Graph $graph): string method can be used to export the given graph instance., (*5)

$graph = new Fhaculty\Graph\Graph();

$a = $graph->createVertex('a');
$b = $graph->createVertex('b');
$a->createEdgeTo($b);

$exporter = new Graphp\TrivialGraphFormat\TrivialGraphFormat();
$data = $exporter->getOutput($graph);

file_put_contents('example.tgf', $data);
echo $data;

The TGF output will look something like this:, (*6)

1 a
2 b
#
1 2

This method only supports exporting the basic graph structure, with all vertices and directed and undirected edges., (*7)

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., (*8)

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., (*9)

Install

The recommended way to install this library is through composer. New to composer?, (*10)

{
    "require": {
        "graphp/trivial-graph-format": "~0.1.0"
    }
}

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., (*11)

Tests

To run the test suite, you first need to clone this repo and then install all dependencies through Composer:, (*12)

$ composer install

To run the test suite, go to the project root and run:, (*13)

$ php vendor/bin/phpunit

License

Released under the terms of the permissive MIT license., (*14)

The Versions

08/03 2015

dev-master

9999999-dev https://github.com/graphp/trivial-graph-format

Trivial Graph Format (TGF) is a simple text-based file format for describing graphs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Christian LĂŒck

trivial graph format tgf

08/03 2015

v0.1.1

0.1.1.0 https://github.com/graphp/trivial-graph-format

Trivial Graph Format (TGF) is a simple text-based file format for describing graphs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Christian LĂŒck

trivial graph format tgf

24/02 2015

v0.1.0

0.1.0.0 https://github.com/graphp/trivial-graph-format

Trivial Graph Format (TGF) is a simple text-based file format for describing graphs

  Sources   Download

MIT

The Requires

 

The Development Requires

by Christian LĂŒck

trivial graph format tgf