graphonline/en/wiki/wiki.d/Help.AdjacencyMatrix
2020-02-08 13:00:25 +03:00

28 lines
20 KiB
Plaintext
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version=pmwiki-2.2.75 ordered=1 urlencoded=1
agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 OPR/43.0.2442.1165
author=
charset=UTF-8
csum=
ctime=1470752752
description=About adjacency matrix and the way it can be applied in Graph Online
host=37.146.179.134
name=Help.AdjacencyMatrix
passwdedit=@lock
rev=5
targets=
text=(:Title Adjacency matrix:)%0a(:Description About adjacency matrix and the way it can be applied in Graph Online:)%0a%0a!! What is adjacency matrix?%0aAdjacency matrix is the type of graph visualization in form of matrix; crossing of columns and rows determines the edges. Using adjacency matrix you can determine the edges' weight and orientation. Every matrix's row and column correspond to edges; the number of the row corresponds to the vertex, where an edge starts; the number of the column corresponds to the vertex where an edge finishes. %0a%0a!! Examples of adjacency matrices%0a%0a(:table width=100%25 :)%0a(:head:) Graph consisting of 3 connected vertices%0a(:head:) Graph with oriented edge%0a(:head:) Graph consistiong of 4 vertices without edges%0a(:cellnr align=center valign=center:) %0a[@ %0a0, 1, 1, %0a1, 0, 1, %0a1, 1, 0, %0a@]%0a(:cell align=center valign=center :) %0a[@%0a0, 1, %0a0, 0, %0a@]%0a(:cell align=center valign=center:) %0a[@%0a0, 0, 0, 0, %0a0, 0, 0, 0, %0a0, 0, 0, 0, %0a0, 0, 0, 0, %0a@]%0a(:cellnr align=center:) %25width=200px%25http://graphonline.ru/wiki/uploads/Справка/3%2520vertexes%2520Graph.png%0a(:cell align=center:) %25width=200px%25http://graphonline.ru/wiki/uploads/Справка/2%2520vertexes%2520orient%2520Graph.png%0a(:cell align=center:) %25width=200px%25http://graphonline.ru/wiki/uploads/Справка/4%2520vertexes%2520Graph.png%0a(:cellnr align=center:) [[http://graphonline.ru/?graph=xPHsDIALOpAQstFq | Ссылка на граф]]%0a(:cell align=center:) [[http://graphonline.ru/?graph=XGzjPUrUjVQleOzJ | Ссылка на граф]]%0a(:cell align=center:) [[http://graphonline.ru/?graph=rFmgAUzjzIZCuGHM | Ссылка на граф]]%0a(:tableend:)%0a%0a!! Adjacency matrix in Graph Online %0a%0aGraph Online allows you to create [[http://graphonline.ru/create_graph_by_matrix| Создать граф по матрице смежности]].%0a%0a%25width=450px%25http://graphonline.ru/wiki/uploads/Справка/create_graph_from_matrix.jpg%0a%0aMoreover, users can edit the existing adjacency matrix. In order to do that you have to choose Graph in the menu bar and then Adjacency matrix.%0a%0a%25width=450px%25http://graphonline.ru/wiki/uploads/Справка/edit_graph_matrix.jpg%0a%0aIn order to use adjacency matrix you have to enter it in the right form.%0a%0a!! How to enter adjacency matrix%0a%0a%25id=matrixFormat%25 Entering an adjacency matrix you have to take into account the following principles:%0a%0a# A matrix should be square; the number of rows should be equal to the number of columns.%0a# Every new row should be entered from the new line.%0a# Every figure is followed by comma (,)%0a# The weight of the edge should be a positive number. Value "0" means the edge does not exist.%0a%0aLet's look through the major mistakes which the user may face while entering an adjacency matrix%0a%0a!!! Major mistakes which happen while entering adjacency matrix%0a%0a(:table width=100%25 cellspacing=4 :)%0a(:head:) The wrong matrix%0a(:head:) The cause of the mistake%0a(:head:) The correct matrix%0a(:cellnr align=center valign=center bgcolor=#ffcccc:) %0a[@ %0a5,5,5,5,5%0a5,5,5,5,5%0a5,5,5,5,5%0a@]%0a(:cell align=center valign=center:) The matrix is not square; the number of rows is 3 and the number of columns is 5 %0a(:cell align=center valign=center bgcolor=#ccffcc:)%0a[@ %0a5,5,5,5,5%0a5,5,5,5,5%0a5,5,5,5,5%0a5,5,5,5,5%0a5,5,5,5,5%0a@]%0a(:cellnr align=center valign=center bgcolor=#ffcccc:) %0a[@ %0a0,1,1,1,0,1,0,0,0%0a1,0,1,0,0,1,1,1,0%0a1,1,0,1,1,0,1,0,0%0a1,0,1,0,1,1,1,1,0%0a0,0,1,1,0,1,0,0,0%0a1,1,0,1,1,0,1,1,1%0a0,1,1,1,0,1,0,0,1%0a0,0,0,0,0,1,1,1,0%0a@]%0a(:cell align=center valign=center:) The matrix is not square; the number of rows is 8 and the number of columns is 9%0a(:cell align=center valign=center bgcolor=#ccffcc:) %0a[@ %0a0,1,1,1,0,1,0,0,0%0a1,0,1,0,0,1,1,1,0%0a1,1,0,1,1,0,1,0,0%0a1,0,1,0,1,1,1,1,0%0a0,0,1,1,0,1,0,0,0%0a1,1,0,1,1,0,1,1,1%0a0,1,1,1,0,1,0,0,1%0a0,0,0,0,0,1,1,1,0%0a0,0,0,0,0,0,0,0,0%0a@]%0a(:cellnr align=center valign=center bgcolor=#ffcccc:) %0a[@ %0a1, 0, 0%0a1, 2, 0%0a-2, 1, 0%0a0, -2, 0%0a1, 3, 0%0a@]%0a(:cell align=center valign=center:) The matrix is not square, it also contains negative values%0a(:cell align=center valign=center bgcolor=#ccffcc:) %0a[@ %0a1, 0, 0%0a1, 2, 0%0a2, 1, 0%0a@]%0a(:cellnr align=center valign=center bgcolor=#ffcccc:) %0a[@ %0a1 2,%0a1 3,%0a1 4,%0a4 5,%0a5 2,%0a6 3,%0a@]%0a(:cell align=center valign=center:) Dependence between the vertices was entered instead of an adjacency matrix. You have to enter an adjacency matrix for that graph.%0a(:cell align=center valign=center bgcolor=#ccffcc:) %0a[@ %0a0, 1, 1, 1, 0, 0, %0a0, 0, 0, 0, 0, 0, %0a0, 0, 0, 0, 0, 0, %0a0, 0, 0, 0, 1, 0, %0a0, 1, 0, 0, 0, 0, %0a0, 0, 1, 0, 0, 0, %0a@]%0a(:cellnr align=center valign=center bgcolor=#ffcccc:) %0a[@ %0a∞,10,9,10%0a10,∞,∞,∞%0a∞,5,∞.8%0a10,∞,∞,∞%0a@]%0a(:cell align=center valign=center:) Instead of symbol "∞" use "0".%0a(:cell align=center valign=center bgcolor=#ccffcc:) %0a[@ %0a0,10,9,10%0a10,0,0,0%0a0,5,0.8%0a10,0,0,0%0a@]%0a(:cellnr align=center valign=center bgcolor=#ffcccc:) %0a[@ %0a-, 8, -, 1, -, -, %0a-, -, 4, 7, 2, -, %0a-, -, -, -, 4, 2, %0a-, -, 9, -, 7, -, %0a-, -, -, -, -, 6, %0ainf , -, -, -, -, -, %0a@]%0a(:cell align=center valign=center:) Instead of symbol "-" or 'inf" use 0".%0a(:cell align=center valign=center bgcolor=#ccffcc:) %0a[@ %0a0, 8, 0, 1, 0, 0, %0a0, 0, 4, 7, 2, 0, %0a0, 0, 0, 0, 4, 2, %0a0, 0, 9, 0, 7, 0, %0a0, 0, 0, 0, 0, 6, %0a0, 0, 0, 0, 0, 0, %0a@]%0a%0a
time=1495230326
title=Adjacency matrix
author:1471104527=
diff:1471104527:1471104471:=148c148%0a%3c (:cell align=center valign=center:) Instead of symbol "∞" use "0".%0a---%0a> (:cell align=center valign=center:) Вместо символаInstead of symbol "∞" use "0".%0a
host:1471104527=128.68.33.133
author:1471104471=
diff:1471104471:1471028739:=5,8c5,8%0a%3c Adjacency matrix is the type of graph visualization in form of matrix; crossing of columns and rows determines the edges. Using adjacency matrix you can determine the edges' weight and orientation. Every matrix's row and column correspond to edges; the number of the row corresponds to the vertex, where an edge starts; the number of the column corresponds to the vertex where an edge finishes. %0a%3c %0a%3c !! Examples of adjacency matrices%0a%3c %0a---%0a> Adjacency matrix is the type of graph visualization in form of matrix; crossing of columns and rows determines the edges. Using adjacency matrix you can determine the edges' weight and orientation. Каждая строка и столбец матрицы соответствуют вершинам, номер строки соответствует вершине, из которой выходит дуга, а номер столбца - в какую входит дуга.%0a> %0a> !! Примеры матриц смежности%0a> %0a10,12c10,12%0a%3c (:head:) Graph consisting of 3 connected vertices%0a%3c (:head:) Graph with oriented edge%0a%3c (:head:) Graph consistiong of 4 vertices without edges%0a---%0a> (:head:) Граф из 3 соединённых вершин%0a> (:head:) Граф с ориентированной дугой%0a> (:head:) Граф из 4 вершин без дуг%0a39,42c39,42%0a%3c !! Adjacency matrix in Graph Online %0a%3c %0a%3c Graph Online allows you to create [[http://graphonline.ru/create_graph_by_matrix| Создать граф по матрице смежности]].%0a%3c %0a---%0a> !! Использование Матрицы смежности в сервисе Граф Онлайн%0a> %0a> Сервис Граф Онлайн предоставляет вам возможность создать [[http://graphonline.ru/create_graph_by_matrix| Создать граф по матрице смежности]].%0a> %0a45,46c45,46%0a%3c Moreover, users can edit the existing adjacency matrix. In order to do that you have to choose Graph in the menu bar and then Adjacency matrix.%0a%3c %0a---%0a> Также вы можете редактировать существующую матрицу смежности. Для этого вам необходимо выбрать меню Граф -> Матрица смежности.%0a> %0a49,63c49,63%0a%3c In order to use adjacency matrix you have to enter it in the right form.%0a%3c %0a%3c !! How to enter adjacency matrix%0a%3c %0a%3c %25id=matrixFormat%25 Entering an adjacency matrix you have to take into account the following principles:%0a%3c %0a%3c # A matrix should be square; the number of rows should be equal to the number of columns.%0a%3c # Every new row should be entered from the new line.%0a%3c # Every figure is followed by comma (,)%0a%3c # The weight of the edge should be a positive number. Value "0" means the edge does not exist.%0a%3c %0a%3c Let's look through the major mistakes which the user may face while entering an adjacency matrix%0a%3c %0a%3c !!! Major mistakes which happen while entering adjacency matrix%0a%3c %0a---%0a> Для того чтобы использовать матрицу смежности вам необходимо ввести её в правильном формате.%0a> %0a> !! Формат ввода матрицы смежности%0a> %0a> %25id=matrixFormat%25 Вводя матрицу смежности вам необходимо руководствоваться следующими правилами:%0a> %0a> # Матрица должна быть квадратная - число строк равно числу столбцов.%0a> # Каждая новая строка вводится с новой строки.%0a> # Каждое значение разделяется замятой (,)%0a> # Вес дуг должен быть положительным числом. Значение 0 значит что дуги не существует.%0a> %0a> А теперь рассмотрим основные ошибки ввода матриц смежности%0a> %0a> !!! Основные ошибки ввода матриц смежности%0a> %0a65,67c65,67%0a%3c (:head:) The wrong matrix%0a%3c (:head:) The cause of the mistake%0a%3c (:head:) The correct matrix%0a---%0a> (:head:) Неправильная матрица%0a> (:head:) Причина ошибки%0a> (:head:) Правильная матрица%0a74c74%0a%3c (:cell align=center valign=center:) The matrix is not square; the number of rows is 3 and the number of columns is 5 %0a---%0a> (:cell align=center valign=center:) Матрица не квадратная: число строк - 3, а число столбцов - 5%0a94c94%0a%3c (:cell align=center valign=center:) The matrix is not square; the number of rows is 8 and the number of columns is 9%0a---%0a> (:cell align=center valign=center:) Матрица не квадратная: число строк - 8, а число столбцов - 9%0a115c115%0a%3c (:cell align=center valign=center:) The matrix is not square, it also contains negative values%0a---%0a> (:cell align=center valign=center:) Матрица не квадратная, также содержит отрицательные значения%0a131c131%0a%3c (:cell align=center valign=center:) Dependence between the vertices was entered instead of an adjacency matrix. You have to enter an adjacency matrix for that graph.%0a---%0a> (:cell align=center valign=center:) Введена не матрица смежности, а отношение между вершинами. Необходимо ввести матрицу смежности для этого графа.%0a148c148%0a%3c (:cell align=center valign=center:) Вместо символаInstead of symbol "∞" use "0".%0a---%0a> (:cell align=center valign=center:) Вместо символа ∞ используйте 0.%0a165c165%0a%3c (:cell align=center valign=center:) Instead of symbol "-" or 'inf" use 0".%0a---%0a> (:cell align=center valign=center:) Вместо символа - или inf используйте 0.%0a
host:1471104471=128.68.33.133
author:1471028739=
diff:1471028739:1470752752:=1,175d0%0a%3c (:Title Adjacency matrix:)%0a%3c (:Description About adjacency matrix and the way it can be applied in Graph Online:)%0a%3c %0a%3c !! What is adjacency matrix?%0a%3c Adjacency matrix is the type of graph visualization in form of matrix; crossing of columns and rows determines the edges. Using adjacency matrix you can determine the edges' weight and orientation. Каждая строка и столбец матрицы соответствуют вершинам, номер строки соответствует вершине, из которой выходит дуга, а номер столбца - в какую входит дуга.%0a%3c %0a%3c !! Примеры матриц смежности%0a%3c %0a%3c (:table width=100%25 :)%0a%3c (:head:) Граф из 3 соединённых вершин%0a%3c (:head:) Граф с ориентированной дугой%0a%3c (:head:) Граф из 4 вершин без дуг%0a%3c (:cellnr align=center valign=center:) %0a%3c [@ %0a%3c 0, 1, 1, %0a%3c 1, 0, 1, %0a%3c 1, 1, 0, %0a%3c @]%0a%3c (:cell align=center valign=center :) %0a%3c [@%0a%3c 0, 1, %0a%3c 0, 0, %0a%3c @]%0a%3c (:cell align=center valign=center:) %0a%3c [@%0a%3c 0, 0, 0, 0, %0a%3c 0, 0, 0, 0, %0a%3c 0, 0, 0, 0, %0a%3c 0, 0, 0, 0, %0a%3c @]%0a%3c (:cellnr align=center:) %25width=200px%25http://graphonline.ru/wiki/uploads/Справка/3%2520vertexes%2520Graph.png%0a%3c (:cell align=center:) %25width=200px%25http://graphonline.ru/wiki/uploads/Справка/2%2520vertexes%2520orient%2520Graph.png%0a%3c (:cell align=center:) %25width=200px%25http://graphonline.ru/wiki/uploads/Справка/4%2520vertexes%2520Graph.png%0a%3c (:cellnr align=center:) [[http://graphonline.ru/?graph=xPHsDIALOpAQstFq | Ссылка на граф]]%0a%3c (:cell align=center:) [[http://graphonline.ru/?graph=XGzjPUrUjVQleOzJ | Ссылка на граф]]%0a%3c (:cell align=center:) [[http://graphonline.ru/?graph=rFmgAUzjzIZCuGHM | Ссылка на граф]]%0a%3c (:tableend:)%0a%3c %0a%3c !! Использование Матрицы смежности в сервисе Граф Онлайн%0a%3c %0a%3c Сервис Граф Онлайн предоставляет вам возможность создать [[http://graphonline.ru/create_graph_by_matrix| Создать граф по матрице смежности]].%0a%3c %0a%3c %25width=450px%25http://graphonline.ru/wiki/uploads/Справка/create_graph_from_matrix.jpg%0a%3c %0a%3c Также вы можете редактировать существующую матрицу смежности. Для этого вам необходимо выбрать меню Граф -> Матрица смежности.%0a%3c %0a%3c %25width=450px%25http://graphonline.ru/wiki/uploads/Справка/edit_graph_matrix.jpg%0a%3c %0a%3c Для того чтобы использовать матрицу смежности вам необходимо ввести её в правильном формате.%0a%3c %0a%3c !! Формат ввода матрицы смежности%0a%3c %0a%3c %25id=matrixFormat%25 Вводя матрицу смежности вам необходимо руководствоваться следующими правилами:%0a%3c %0a%3c # Матрица должна быть квадратная - число строк равно числу столбцов.%0a%3c # Каждая новая строка вводится с новой строки.%0a%3c # Каждое значение разделяется замятой (,)%0a%3c # Вес дуг должен быть положительным числом. Значение 0 значит что дуги не существует.%0a%3c %0a%3c А теперь рассмотрим основные ошибки ввода матриц смежности%0a%3c %0a%3c !!! Основные ошибки ввода матриц смежности%0a%3c %0a%3c (:table width=100%25 cellspacing=4 :)%0a%3c (:head:) Неправильная матрица%0a%3c (:head:) Причина ошибки%0a%3c (:head:) Правильная матрица%0a%3c (:cellnr align=center valign=center bgcolor=#ffcccc:) %0a%3c [@ %0a%3c 5,5,5,5,5%0a%3c 5,5,5,5,5%0a%3c 5,5,5,5,5%0a%3c @]%0a%3c (:cell align=center valign=center:) Матрица не квадратная: число строк - 3, а число столбцов - 5%0a%3c (:cell align=center valign=center bgcolor=#ccffcc:)%0a%3c [@ %0a%3c 5,5,5,5,5%0a%3c 5,5,5,5,5%0a%3c 5,5,5,5,5%0a%3c 5,5,5,5,5%0a%3c 5,5,5,5,5%0a%3c @]%0a%3c (:cellnr align=center valign=center bgcolor=#ffcccc:) %0a%3c [@ %0a%3c 0,1,1,1,0,1,0,0,0%0a%3c 1,0,1,0,0,1,1,1,0%0a%3c 1,1,0,1,1,0,1,0,0%0a%3c 1,0,1,0,1,1,1,1,0%0a%3c 0,0,1,1,0,1,0,0,0%0a%3c 1,1,0,1,1,0,1,1,1%0a%3c 0,1,1,1,0,1,0,0,1%0a%3c 0,0,0,0,0,1,1,1,0%0a%3c @]%0a%3c (:cell align=center valign=center:) Матрица не квадратная: число строк - 8, а число столбцов - 9%0a%3c (:cell align=center valign=center bgcolor=#ccffcc:) %0a%3c [@ %0a%3c 0,1,1,1,0,1,0,0,0%0a%3c 1,0,1,0,0,1,1,1,0%0a%3c 1,1,0,1,1,0,1,0,0%0a%3c 1,0,1,0,1,1,1,1,0%0a%3c 0,0,1,1,0,1,0,0,0%0a%3c 1,1,0,1,1,0,1,1,1%0a%3c 0,1,1,1,0,1,0,0,1%0a%3c 0,0,0,0,0,1,1,1,0%0a%3c 0,0,0,0,0,0,0,0,0%0a%3c @]%0a%3c (:cellnr align=center valign=center bgcolor=#ffcccc:) %0a%3c [@ %0a%3c 1, 0, 0%0a%3c 1, 2, 0%0a%3c -2, 1, 0%0a%3c 0, -2, 0%0a%3c 1, 3, 0%0a%3c @]%0a%3c (:cell align=center valign=center:) Матрица не квадратная, также содержит отрицательные значения%0a%3c (:cell align=center valign=center bgcolor=#ccffcc:) %0a%3c [@ %0a%3c 1, 0, 0%0a%3c 1, 2, 0%0a%3c 2, 1, 0%0a%3c @]%0a%3c (:cellnr align=center valign=center bgcolor=#ffcccc:) %0a%3c [@ %0a%3c 1 2,%0a%3c 1 3,%0a%3c 1 4,%0a%3c 4 5,%0a%3c 5 2,%0a%3c 6 3,%0a%3c @]%0a%3c (:cell align=center valign=center:) Введена не матрица смежности, а отношение между вершинами. Необходимо ввести матрицу смежности для этого графа.%0a%3c (:cell align=center valign=center bgcolor=#ccffcc:) %0a%3c [@ %0a%3c 0, 1, 1, 1, 0, 0, %0a%3c 0, 0, 0, 0, 0, 0, %0a%3c 0, 0, 0, 0, 0, 0, %0a%3c 0, 0, 0, 0, 1, 0, %0a%3c 0, 1, 0, 0, 0, 0, %0a%3c 0, 0, 1, 0, 0, 0, %0a%3c @]%0a%3c (:cellnr align=center valign=center bgcolor=#ffcccc:) %0a%3c [@ %0a%3c ∞,10,9,10%0a%3c 10,∞,∞,∞%0a%3c ∞,5,∞.8%0a%3c 10,∞,∞,∞%0a%3c @]%0a%3c (:cell align=center valign=center:) Вместо символа ∞ используйте 0.%0a%3c (:cell align=center valign=center bgcolor=#ccffcc:) %0a%3c [@ %0a%3c 0,10,9,10%0a%3c 10,0,0,0%0a%3c 0,5,0.8%0a%3c 10,0,0,0%0a%3c @]%0a%3c (:cellnr align=center valign=center bgcolor=#ffcccc:) %0a%3c [@ %0a%3c -, 8, -, 1, -, -, %0a%3c -, -, 4, 7, 2, -, %0a%3c -, -, -, -, 4, 2, %0a%3c -, -, 9, -, 7, -, %0a%3c -, -, -, -, -, 6, %0a%3c inf , -, -, -, -, -, %0a%3c @]%0a%3c (:cell align=center valign=center:) Вместо символа - или inf используйте 0.%0a%3c (:cell align=center valign=center bgcolor=#ccffcc:) %0a%3c [@ %0a%3c 0, 8, 0, 1, 0, 0, %0a%3c 0, 0, 4, 7, 2, 0, %0a%3c 0, 0, 0, 0, 4, 2, %0a%3c 0, 0, 9, 0, 7, 0, %0a%3c 0, 0, 0, 0, 0, 6, %0a%3c 0, 0, 0, 0, 0, 0, %0a%3c @]%0a%3c %0a
host:1471028739=128.68.33.133
author:1470752752=
diff:1470752752:1470752752:=
host:1470752752=178.124.194.82