# isisomorphic

## 语法

``tf = isisomorphic(G1,G2)``
``tf = isisomorphic(G1,G2,Name,Value)``

## 说明

`如果图 `G1` 和 `G2` 之间存在图的同构，`tf = isisomorphic(G1,G2)` 将返回逻辑值 `1` (`true`)；否则，将返回逻辑值 `0` (`false`)。`

``tf = isisomorphic(G1,G2,Name,Value)` 使用一个或多个名称-值对组参数指定其他选项。例如，您可以指定 `'NodeVariables'` 和一个节点变量列表，以指示同构必须保留这些变量才有效。`

## 示例

```G1 = digraph([1 1 1 2 3 4],[2 3 4 4 4 1]); G2 = digraph([3 3 3 2 1 4],[1 4 2 3 2 2]); subplot(1,2,1) plot(G1) subplot(1,2,2) plot(G2)```

`isisomorphic(G1,G2)`
```ans = logical 1 ```

```G1 = graph([1 1 1 2 2 3 3 4 5 5 7 7],[2 4 5 3 6 4 7 8 6 8 6 8]); plot(G1,'XData',[1 4 4 1 2 3 3 2],'YData',[4 4 1 1 3 3 2 2])```

```G2 = graph({'a' 'a' 'a' 'b' 'b' 'b' 'c' 'c' 'c' 'd' 'd' 'd'}, ... {'g' 'h' 'i' 'g' 'h' 'j' 'g' 'i' 'j' 'h' 'i' 'j'}); plot(G2,'XData',[1 2 2 2 1 2 1 1],'YData',[4 4 3 2 3 1 2 1])```

`tf = isisomorphic(G1,G2)`
```tf = logical 1 ```

```G1 = graph({'d' 'e' 'f'},{'e' 'f' 'd'}); G1.Nodes.Color = {'red' 'red' 'blue'}'; G2 = graph({'a' 'b' 'c'},{'b' 'c' 'a'}); G2.Nodes.Color = {'blue' 'blue' 'red'}';```

```subplot(1,2,1) p1 = plot(G1); highlight(p1,{'d' 'e'},'NodeColor','r') subplot(1,2,2) p2 = plot(G2); highlight(p2,'c','NodeColor','r')```

`tf = isisomorphic(G1,G2)`
```tf = logical 1 ```

`tf = isisomorphic(G1,G2,'NodeVariables','Color')`
```tf = logical 0 ```

## 输入参数

`G1``G2` 必须同为 `graph` 对象，或者同为 `digraph` 对象。