## mnas-graph

2021-10-21

System mnas-graph defines basic functions for creating a graph data structure and displaying it via graphviz.

### Upstream URL

### Author

Nick Matvyeyev <mnasoft@gmail.com>

### License

GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 or later

README

Provided Systems

Mnas-Graph

# 1Purpose

This project defines the basic functions for creating and displaying adata structure of the Graph type.The transformation of the **Graph** into a format suitable for
visualization is carried out using the Graphviz program.

# 2Examples

## 2.1Example 1

```
(mnas-graph/view:view-graph
(mnas-graph:make-graph
'(("a" "b") ("a" "c") ("a" "d") ("b" "c") ("c" "d"))))
```

## 2.2Example 2

```
(let*
((g (make-instance 'mnas-graph:<graph>))
(v1 (make-instance 'mnas-graph:<node> :owner g :name "v1"))
(v2 (make-instance 'mnas-graph:<node> :owner g :name "v2"))
(v3 (make-instance 'mnas-graph:<node> :owner g :name "v3"))
(r1 (make-instance 'mnas-graph:<edge> :from v1 :to v2))
(r2 (make-instance 'mnas-graph:<edge> :from v2 :to v3))
(r3 (make-instance 'mnas-graph:<edge> :from v3 :to v1)))
(mnas-graph:insert-to v1 g)
(mnas-graph:insert-to v2 g)
(mnas-graph:insert-to v3 g)
(mnas-graph:insert-to r1 g)
(mnas-graph:insert-to r2 g)
(mnas-graph:insert-to r3 g)
(mnas-graph/view:view-graph g))
```