Mendz's Graph Is IFormattable, And You'll Love It

Mendz.Graph's Graph class implements IFormattable. The default DOTFormatProvider and DOTFormatter implementations included in Mendz.Graph are really just samples of what can be done. Developers are encouraged to create and use their own IFormatProvider and ICustomFormatter implementations for the Graph.

Note that Mendz's Graph IFormattable.ToString() implementation can support your own custom format providers and formatters. If you will review the codes for Graph.ToSTring(), DOTFormatProvider and DOTFormatter, you should find that parsing the Graph to generate your own DOT notation, or what have you, is not at all complicated.

Mendz's Graph.ToString() invites developers to innovate. Using the DOT notation is one direction to take. Create your own format providers/formatters to help present/visualize your Graph data.

For large Graph instances, it is recommended that developers create programs that will parse and stream the Graph data for formatting or for serialization purposes. ToString() returns a string, which is one solid memory allocation. Using streaming techniques to consume Graph data can be a smart option. For example, you can create a ToStream() extension method that will consume the Graph and stream the formatted results to your graph rendering/visualization engine or to your graph persistence store (graph database or memory mapped files, perhaps?).

Mendz.Graph is all about loading and accessing graph data in memory. Its ToString() implementation is not the end of its use case. Get Mendz.Graph.Representation to access advanced capabilities that can let you build your own graph algorithms and operations library -- ex.: searches, traversals, sub-graph extractions, Math operations and even graph data compressions. Depending on how you'll build your solution, you might even find that Mendz.Graph.Representation classes and types can be the best way to feed data to your graph rendering/visualization engine, or to your analytics applications, while at the same time saving memory and runtime resources.

Comments