Chain code pictures

from Wikipedia, the free encyclopedia

Chain code images ( Chain Code Pictures ) are images using formal grammars are generated. A word generated by such a grammar is interpreted as exactly one image in that the individual symbols are interpreted as directions and a drawing is thus described in a coordinate system.

Basics

The integer coordinate system and its neighboring points for each point are given

, , , ,

wherein , , or intuitive to the upper ( u p), lower ( d own), Right ( r ight) or left ( l eft) are adjacent point.

Let the set of directions be defined with .

Furthermore, a unit route is understood to be the route that is connected by two neighboring points. That means, for every point and every direction there is a line between and (diagonal lines are excluded). A unit distance is represented by the pair of points , where and are geometrically the same.

A ( simple ) image is a finite set of unit segments and the set of all points of .

This is called a triple , where is a simple picture and the start and end point are called the drawn picture .

Two simple images and are equivalent - one writes - if and only if two numbers exist, such that if and only if . Analog hot two drawn images and if and equivalent - to write - if two numbers exist, so if and only if , and , . So, intuitively, images are the same except for a shift in the coordinate system. As one can easily show, are and equivalence relations of all simple or drawn images through the crowd.

A simple picture is called a ( simple ) sub- picture of the simple picture if a simple picture with and exists.

A picture is a ( simple ) chain code image when a finite sequence of unit distances with and , , there is so true. Consequently, a chain-code picture is always connected.

Generation through formal grammars

Chain code pictures and words

Due to the definition of chain code pictures that with words (can chain codes or chain codes ) via associated by a chain-code image with the result and , , the word is assigned.

On the other hand, it gives each word a signed chain code image ( drawn chain code picture ) inductively as follows:

  • if so then
  • If , , and , then

With is the basic chain code picture from .

Words can now be generated with a formal grammar and interpreted as chain code images. Let the set of all images generated by be or , where is the language generated by (see Language generated by G ) - it is also called chain-code-image language .

example

Let be a given formal grammar. The language generated by is

.

The amount of images created by is shown in the figure below:

The chain-code-picture-language . The starting point of an image is marked with a green circle and the end point with an orange rectangle.

So you get a countable number of stacks of arbitrary but fixed height, which consist of squares the length of the edge .

Chain-Code-Image-Language Hierarchy

Analogous to formal languages , a chain-code-image language is called regular or context-free or monotonic (or context-sensitive) or recursively enumerable if there is a regular or context-free or monotonic (or context-sensitive) or recursively enumerable formal grammar so that applies (see Chomsky hierarchy ). With , , and referred to the quantities (families) of all regular, context-free, monotonous and recursively enumerable chain code picture languages.

An important finding is the validity of the inclusions or equality . Thus, in fact, only three real families are considered.

Decision problems for chain-code-image languages

Classic decision problems

As for formal languages, important decision problems can be formulated in the same way for chain-code-image languages :

Image problem (also member problem )

  • A formal grammar and a chain code image are given .
  • Is there a word that makes it true?

The image problem is decidable for context-free formal grammars and undecidable for context-sensitive formal grammars . This problem is NP-complete for regular formal grammars .

1. special image problem

  • A formal grammar and a chain code image are given .
  • Is the amount finite?

So one asks whether there are finitely or infinitely many words that generate the chain-code image . Like the image problem, this problem is decidable for context-free formal grammars and undecidable for context-sensitive formal grammars .

2. special image problem

  • A formal grammar and a chain code image are given .
  • Does the set have exactly one element?

Thus, asked whether the chain code picture of exactly one word out is generated. This problem is again decidable for context-free formal grammars and undecidable for context-sensitive formal grammars .

Underpicture problem

  • A formal grammar and a chain code image are given .
  • Is there a chain code image such that is a subimage of ?

The sub-picture problem is decidable for context-free formal grammars and undecidable for context-sensitive formal grammars .

Universal underpicture problem

  • A formal grammar and a chain code image are given .
  • Is a sub-picture of every chain code picture ?

For regular formal grammars the universal sub-picture problem is decidable.

Emptiness problem

  • A formal grammar is given .
  • Is the crowd empty?

The emptiness problem is decidable for context-free formal grammars and undecidable for context-sensitive formal grammars .

Finiteness problem

  • A formal grammar is given .
  • Is the amount finite?

The finiteness problem is decidable for context-free formal grammars and undecidable for context-sensitive formal grammars .

Equivalence problem

  • There are two formal grammars and .
  • Does that mean that both grammars generate the same chain-code images via their words?

The equivalence problem is already for regular formal grammars and undecidable.

Note that due to the inclusions established in the section Hierarchy of Chain-Code-Image-Languages , the following applies to each of the named problems with formal grammar and :

  • if for with is decidable, for a formal grammar with , and is also decidable.
  • if for with is undecidable, for a formal grammar with , and is also undecidable.

Geometric decision problems

First some geometric properties of a chain code image are defined below:

  • is a simple curve if all nodes have degree 2 or less.
  • is called a closed simple curve if all nodes have exactly degree 2.
  • is called regular if all nodes have the same degree.
  • is called a tree if it does not contain a closed simple curve as a partial image.
  • is Eulerian when all nodes are of a degree.
  • is called Hamiltonian when a simple curve has as a partial image that contains all the nodes of .

Studies have shown that even for regular formal grammars it is undecidable whether

  • a simple curve,
  • a closed simple curve,
  • a regular picture,
  • a tree,
  • an Euler's picture,
  • a Hamiltonian picture

includes.

For regular formal grammars , however, it can be decided whether

  • all pictures are of closed simple curve,
  • all pictures are of rectangles ,
  • contains a rectangle,
  • contains a convex image.

Furthermore, for context-free formal grammars it can be decided whether all images are of trees.

Generalizations

In the following some (informal) comments are made about extensions and generalizations of chain code images in order to get better images in a certain way.

Adding new directions

A certainly intuitive approach to expanding chain-code images is to add new directions to the four already known: up, down, right, and left. So can for example for all the neighboring points

, , , ,

can be added. Accordingly, one obtains the additional upper right directions ( u p r ight), top left ( u p l eft), lower right ( d own r ight) and lower left ( d own l eft), and thus the new alphabet .

The above undecidable problems regarding the alphabet also remain undecidable under the alphabet . The situation is similar for the decidable problems.

Colored chain code pictures

If you want to get colored chain code images, the alphabet can be changed as follows. Instead of just using letters for directions, they are assigned colors. Let be a finite set of colors. Then we get the new alphabet with , i.e. the letters are pairs of the form for and .

Here, too, one obtains similar results for the indecisability and decidability of the above problems.

Non-contiguous chain code images

Chain code images are always connected. If you want to allow non-connected chain-code images, you can add two letters to the alphabet , which in a sense mean putting a pencil on and off. The new alphabet is then. Intuitive stands for putting the pen down and putting it on . For a better understanding, consider the example modified from above below.

Be

a given formal grammar. The language generated by is

.

The generated images look similar to those in the example above, only there are no horizontal stretches, because this is where the pen was always put down and was put back on with the vertical ones:

The amount of images produced by. The starting point of an image is marked with a green circle and the end point with an orange rectangle.

Analogous to chain code images, the family can also be set up and maintained here with the types of the Chomsky hierarchy

and

.

With regard to the above decision problems, the situation here is significantly worse due to the non-correlation of the images.

Generation by other grammars

Another way of creating chain-code-image languages ​​is to use other grammars. For example, Lindenmayer systems , turtle grammars , matrix grammars and collage grammars can be used to generate chain code images.

Depending on the type of grammar used, it is possible that certain images cannot be generated from any grammar of one type, but from a grammar of another type. In particular, it can be shown that there are chain code images that are produced by formal grammars but not by collage grammars.

literature