无向图g的邻接矩阵一定是_矩阵是图

无向图g的邻接矩阵一定是

To study structure,tear away all flesh soonly the bone shows.

要研究结构,请尽快撕掉骨头上所有的肉。

Linear algebra. Graph theory. If you are a data scientist, you have encountered both of these fields in your study or work at some point. They are part of a standard curriculum, frequently used tools in the kit of every engineer.

线性代数。 图论。 如果您是数据科学家,则在研究或工作中有时会遇到这两个领域。 它们是标准课程的一部分,是每个工程师工具包中常用的工具。

What is rarely taught, however, is that they have a very close and fruitful relationship. Graphs can be used to prove strong structural results about matrices easily and beautifully.

但是,很少有人教给他们,他们之间的关系非常密切而富有成果。 图可以用来轻松,美观地证明矩阵的强大结构结果。

To begin our journey, first, we shall take a look at how a matrix can be described with a graph.

首先,我们将看看如何用图形描述矩阵。

矩阵作为图 (Matrices as graphs)

Suppose that we have a square matrix

假设我们有一个方矩阵

We say that the weighted and directed graph

我们说加权有向图

Image for post

corresponds to A if

对应于A,如果

Image for post

If this sounds complicated, here is an example.

如果这听起来很复杂,请举一个例子。

Image for post
The matrix A and its graph
矩阵A及其图

So, for every square matrix, we have a weighted and directed graph. In general, having distinct representations for the same object is colossally useful in mathematics. Sometimes, complex things can be significantly simplified the moment you start looking at things from a different perspective.

因此,对于每个方阵,我们都有一个加权有向图。 通常,对于同一对象具有不同的表示形式在数学中非常有用。 有时,从开始以不同的角度看待事物时,复杂的事物就可以大大简化。

Such as the case of matrices and graphs.

例如矩阵和图形的情况。

在图上走动 (Walking around the graph)

A great feature of the graph representation is the ability to visualize matrix powers.

图形表示的一个很大的特点是可视化矩阵幂的能力。

Suppose that the k-th power of A is denoted by

假设Ak次幂表示为

Image for post

where k can be any positive integer. For k = 2, it is calculated by

其中k可以是任何正整数。 对于k = 2 ,其计算公式为

Image for post

which seems pretty mystical.

这似乎很神秘。

With graphs, there is a pretty simple explanation.

对于图形,有一个非常简单的解释。

For any two nodes i and j, there are several ways to go from one to another. These are called walks. In general, a walk is defined by the sequence of vertices

对于任何两个节点ij ,有几种方法可以从一个转移到另一个。 这些被称为步行 。 通常,走行由顶点序列定义

Image for post

where there must be an edge between vᵢ and vᵢ₊₁. Since the graph of the matrix is weighted, we can define the weight of the walk as well by multiplying the weights of each edge traversed:

vᵢvᵢ₊₁之间必须有一条边。 由于矩阵的图形是加权的,因此我们也可以通过将遍历的每个边的权重相乘来定义步行的权重:

Image for post

(To motivate the definition, let’s suppose we are talking about a transition graph of a discrete Markov chain. In this case, the weight of a walk would equal to the probability of having consecutive states corresponding to the prescribed walk.)

(为激发定义,让我们假设我们正在谈论离散马尔可夫链的转移图。在这种情况下,步行的权重将等于具有对应于规定步行的连续状态的概率。)

So, in graph terminology,

因此,在图形术语中,

Image for post

equals to the sum of weights for all possible k-long paths between i and j. This is easy to see for k = 2, and the general case follows from this using induction.

等于ij之间所有可能的k长路径的权重之和。 对于k = 2来说 ,这很容易看到,并且一般情况是通过归纳法得出的。

Image for post
2 step walks between the nodes i and j
在节点i和j之间走2步

混合起来(字面意思) (Mixing things up (literally))

If you are familiar with some advanced topics in linear algebra, you must have encountered the concept of similar matrices. A and B are called similar if there is a matrix P such that

如果您熟悉线性代数的一些高级主题,那么您一定已经遇到过类似矩阵的概念。 如果存在一个矩阵P使得AB 相似

Image for post

holds. This is a very important concept. If we think of matrices as linear transformations, similarity means that A and B are essentially the same transformations, only in a different coordinate system. (And P is the change of coordinates.)

持有。 这是一个非常重要的概念。 如果我们将矩阵视为线性变换,则相似性意味着AB本质上是相同的变换,只是在不同的坐标系中。 ( P是坐标的变化。)

For example, some matrices can be diagonalized with similarity transformations. So, if we look at them using a special coordinate system, a complicated matrix may just describe a simple stretching.

例如,某些矩阵可以通过相似性变换进行对角化。 因此,如果我们使用特殊的坐标系查看它们,则复杂的矩阵可能只是描述了简单的拉伸。

Image for post
Diagonalization with similarity transform
对角化与相似变换

An important special case is where the similarity matrix P is a so-called permutation matrix.

一个重要的特殊情况是,相似矩阵P是所谓的置换矩阵

置换矩阵 (Permutation matrices)

In mathematics, any bijective mapping

在数学中,任何双射映射

Image for post

is called a permutation. Specifically, if X = {1, 2, …, n}, then π is simply a reordering of the numbers.

称为排列。 具体来说,如果X = {1,2,…,n} ,则π只是数字的重新排序。

Any such permutation can be represented with a matrix, defined by

任何这样的排列都可以用一个矩阵表示,该矩阵由

Image for post

If this is not easy to understand, no worries, I’ll give an example right now. For the permutation defined by

如果这不容易理解,不用担心,我现在就举一个例子。 对于由定义的排列

Image for post

we have

我们有

Image for post

Why do we define the permutation matrix this way? To see this, consider the following:

为什么我们用这种方式定义置换矩阵? 要看到这一点,请考虑以下因素:

Image for post

Multiplying a matrix with a permutation matrix shuffles its rows or columns, depending on whether we multiply from the left or right, so we have

将矩阵与置换矩阵相乘会改变其行或列,具体取决于我们是从左侧还是右侧进行乘法运算,因此

Image for post

and

Image for post

(Recall that matrix multiplication is not commutative.)

(回想一下,矩阵乘法不是可交换的。)

The inverse of a permutation matrix is its transpose. This is easy to see, once you explicitly calculate the product

置换矩阵的逆是它的转置。 一旦您明确计算出乘积,这很容易看到

Image for post

by hand.

用手。

置换矩阵的相似性变换 (Similarity transforms with permutation matrices)

So, let’s go back to graphs and matrices. For a given permutation matrix and a matrix A, what does the similarity transform do? If you think about it, the matrix

因此,让我们回到图和矩阵。 对于给定的置换矩阵和矩阵A ,相似度变换做什么? 如果您考虑一下,矩阵

Image for post

contains identical elements, just its rows and columns are shuffled. In fact, their corresponding graphs are isomorphic with each other. (Which is a fancy expression for being the same after relabeling certain vertices.) Although showing this might look difficult, it can be done by simply noting three key things.

包含相同的元素,只是其行和列被改组。 实际上,它们对应的图彼此同构。 (在重新标注某些顶点后,这是一个很好的表达方式,因为它是相同的。)尽管显示这一点看起来很困难,但可以通过简单地注意三个关键事项来完成。

  • The graph of APπ can be obtained from the graph of A by taking all edges (i, j) and replacing them with (i, π(j)).

    通过取所有边(i,j)并将其替换为(i,π(j))可以从A的图获得APπ的图。

  • Similarly, the graph of PπᵀA can be obtained by replacing (i, j) with

    类似地,可以通过将(i,j)替换为PπᵀA的图

    Similarly, the graph of PπᵀA can be obtained by replacing (i, j) with (π⁻¹(i), j ).

    类似地,可以通过用(π11(i),j)代替(i,j)来获得PπᵀA的图

  • Every permutation graph can be written as a product of permutation matrices where only two elements are swapped. These are called transpositions and their inverses are themselves.

    每个排列图都可以写成仅交换两个元素的排列矩阵的乘积。 这些被称为换位 ,它们的逆本身。

矩阵的结构 (The structure of matrices)

A central question in the theory of matrices is to simplify and reveal their underlying structure by some kind of transformation, like similarity.

矩阵理论中的一个中心问题是通过某种转换(例如相似性)来简化和揭示其基本结构。

For example, as mentioned, certain matrices can be diagonalized by a similarity transformation:

例如,如前所述,某些矩阵可以通过相似性变换进行对角化:

Image for post

Note that this is not true for all matrices. (Check out the spectral theorem if you are interested.) Diagonal matrices are special and easy to work with, so when diagonalization is possible, our job is much simpler.

请注意,并非所有矩阵都是如此。 ( 如果您有兴趣,请查看频谱定理。 )对角矩阵是特殊的并且易于使用,因此,在可能进行对角化的情况下,我们的工作会简单得多。

Another special form is the block-triangular form. The matrix A is upper block-triangular, if there are submatrices B, C, D such that

另一个特殊形式是块三角形形式。 如果存在子矩阵B,C,D ,则矩阵A为上块三角形

Image for post

(Note that 0 is a matrix with all zeros here.)

(请注意, 0是此处为全零的矩阵。)

Definition. A nonnegative matrix A is called reducible, if it can be upper block-triangularized with a similarity transform using a permutation matrix P:

定义。 如果非负矩阵A可以使用置换矩阵P进行相似度变换并进行上块三角化,则称为可约矩阵A

Image for post

If it cannot be done, the matrix is called irreducible. From a graph-theoretical perspective, reducibility is equivalent to partitioning the nodes to two subsets S, T such that there are no outgoing edges from T to S.

如果无法完成,则将矩阵称为不可约 。 从图论的角度来看,可简化性等效于将节点划分为两个子集S,T ,这样就没有从TS的传出边。

Image for post
Graph of a reducible matrix
可约矩阵的图

Imagine that you are randomly walking along the edges of this graph, like a Markov chain. Reducibility means that once you enter T, you cannot leave it. (And, if there is a nonzero probability to enter, you will enter eventually.)

想象一下,您像Markov链一样随机地沿着该图的边缘行走。 可简化性意味着,一旦输入T ,就无法离开它。 (并且,如果输入的可能性非零, 则最终将输入 。)

With irreducible and reducible matrices, nonnegative matrices can be significantly simplified, as we shall see next.

使用不可约矩阵和可约矩阵,可以显着简化非负矩阵,这将在后面看到。

Frobenius范式 (The Frobenius normal form)

Before going into explanations, let’s just state the theorem.

在进行解释之前,让我们先陈述定理。

Theorem. (Frobenius normal form) For every nonnegative matrix A, there is a permutation matrix P such that

定理。 (Frobenius范式)对于每个非负矩阵A ,都有一个置换矩阵P使得

Image for post

where the Aᵢ -s are irreducible matrices.

其中Aᵢ- s是不可约矩阵。

This theorem is hard to prove using only the tools of algebra. (As it was done originally.) However, with graphs, it is almost trivial.

仅使用代数工具很难证明该定理。 (正如最初所做的那样。)但是,对于图形来说,这几乎是微不足道的。

To do this, let’s introduce the concept of strongly connectedness nodes in the graph. The nodes i and j are strongly connected if there is a directed walk from i to j AND a directed walk from j to i. That is, they are mutually reachable from each other.

为此,让我们在图中介绍强连接节点的概念。 如果存在从ij的定向走和从ji的定向走,则节点ij是牢固连接的。 即,它们彼此可以相互到达。

In the language of algebra, the relation “i and j are strongly connected” is an equivalence relation. This means that they partition V into subsets V₁, V₂, …, Vₖ such that all vertices in Vᵢ are strongly connected, but NOT strongly connected with any other vertex.

用代数的语言来说,关系“ ij紧密相连”是等价关系。 这意味着它们划分V输入子集V 1,V 2,...,Vₖ使得Vᵢ所有顶点是密切联系的,但与其他任何顶点非强连接。

For illustration, the graph looks something like this.

为了说明,该图看起来像这样。

Image for post

Believe it or not, this proves the Frobenius theorem about the normal form. To see, we just have to renumber the vertices such that each strongly connected set of vertices are numbered consecutively. As we have seen, the renumbering of vertices is equivalent to applying a permutation transform. Hence,

信不信由你,这证明了Frobenius定理关于正规形式。 要看到,我们只需要对顶点重新编号,以使每个强连接的顶点集都被连续编号。 如我们所见,顶点的重编号等效于应用置换变换。 因此,

Image for post

is of the desired form.

具有所需的形式。

This theorem illustrates the use of graph theory in linear algebra. By simply drawing a picture, so many structural patterns are revealed.

该定理说明了图论在线性代数中的使用。 通过简单地绘制图片,可以显示出许多结构模式。

Of course, this is just the tip of the iceberg. If you are interested, check out the book A Combinatorial Approach to Matrix Theory and Its Applications by Richard A. Brualdi and Dragos Cvetkovic, which is full of beautiful mathematics regarding this topic.

当然,这只是冰山一角。 如果您有兴趣,请阅读Richard A. Brualdi和Dragos Cvetkovic撰写的《矩阵理论及其应用的组合方法 》一书,其中充斥着与此主题相关的精美数学知识。

结论 (Conclusion)

Graphs and matrices go hand in hand. Specifically, graph theory provides a new way to think about matrices. Although this is usually not part of a standard curriculum in linear algebra, it is a fruitful connection between the two. With it, certain structural aspects of matrices become trivial.

图形和矩阵齐头并进。 具体来说,图论提供了一种思考矩阵的新方法。 尽管这通常不是线性代数标准课程的一部分,但这是两者之间卓有成效的联系。 有了它,矩阵的某些结构方面变得无关紧要。

Image for post
Image for post
Image for post

翻译自: https://towardsdatascience.com/matrices-are-graphs-c9034f79cfd8

无向图g的邻接矩阵一定是

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/389206.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

前端绘制绘制图表_绘制我的文学风景

前端绘制绘制图表Back when I was a kid, I used to read A LOT of books. Then, over the last couple of years, movies and TV series somehow stole the thunder, and with it, my attention. I did read a few odd books here and there, but not with the same ferocity …

如何描绘一个vue的项目_描绘了一个被忽视的幽默来源

如何描绘一个vue的项目Source)来源 ) Data visualization is a great way to celebrate our favorite pieces of art as well as reveal connections and ideas that were previously invisible. More importantly, it’s a fun way to connect things we love — visualizing …

数据存储加密和传输加密_将时间存储网络应用于加密预测

数据存储加密和传输加密I’m not going to string you along until the end, dear reader, and say “Didn’t achieve anything groundbreaking but thanks for reading ;)”.亲爱的读者,我不会一直待到最后,然后说: “没有取得任何开创性的…

熊猫分发_熊猫新手:第一部分

熊猫分发For those just starting out in data science, the Python programming language is a pre-requisite to learning data science so if you aren’t familiar with Python go make yourself familiar and then come back here to start on Pandas.对于刚接触数据科学的…

多线程 进度条 C# .net

前言  在我们应用程序开发过程中,经常会遇到一些问题,需要使用多线程技术来加以解决。本文就是通过几个示例程序给大家讲解一下多线程相关的一些主要问题。 执行长任务操作  许多种类的应用程序都需要长时间操作,比如:执行一…

《Linux内核原理与分析》第六周作业

课本:第五章 系统调用的三层机制(下) 中断向量0x80和system_call中断服务程序入口的关系 0x80对应着system_call中断服务程序入口,在start_kernel函数中调用了trap_init函数,trap_init函数中调用了set_system_trap_gat…

Codeforces Round 493

心情不好&#xff0c;被遣散回学校 &#xff0c;心态不好 &#xff0c;为什么会累&#xff0c;一直微笑就好了 #include<bits/stdc.h> using namespace std; int main() {freopen("in","r",stdin);\freopen("out","w",stdout);i…

android动画笔记二

从android3.0&#xff0c;系统提供了一个新的动画&#xff0d;property animation, 为什么系统会提供这样一个全新的动画包呢&#xff0c;先来看看之前的补间动画都有什么缺陷吧1、传统的补间动画都是固定的编码&#xff0c;功能是固定的&#xff0c;扩展难度大。比如传统动画只…

回归分析检验_回归分析

回归分析检验Regression analysis is a reliable method in statistics to determine whether a certain variable is influenced by certain other(s). The great thing about regression is also that there could be multiple variables influencing the variable of intere…

是什么样的骚操作让应用上线节省90%的时间

优秀的程序员 总会想着 如何把花30分钟才能解决的问题 在5分钟内就解决完 例如在应用上线这件事上 通常的做法是 构建项目在本地用maven打包 每次需要clean一次&#xff0c;再build一次 部署包在本地ide、git/svn、maven/gradie 及代码仓库、镜像仓库和云平台间 来回切换 上传部…

Ubuntu 18.04 下如何配置mysql 及 配置远程连接

首先是大家都知道的老三套&#xff0c;啥也不说上来就放三个大招&#xff1a; sudo apt-get install mysql-serversudo apt isntall mysql-clientsudo apt install libmysqlclient-dev 这三步下来mysql就装好了&#xff0c;然后我们偷偷检查一下 sudo netstat -tap | grep mysq…

数据科学与大数据技术的案例_主数据科学案例研究,招聘经理的观点

数据科学与大数据技术的案例I’ve been in that situation where I got a bunch of data science case studies from different companies and I had to figure out what the problem was, what to do to solve it and what to focus on. Conversely, I’ve also designed case…

队列的链式存储结构及其实现_了解队列数据结构及其实现

队列的链式存储结构及其实现A queue is a collection of items whereby its operations work in a FIFO — First In First Out manner. The two primary operations associated with them are enqueue and dequeue.队列是项目的集合&#xff0c;由此其操作以FIFO(先进先出)的方…

cad2016珊瑚_预测有马的硬珊瑚覆盖率

cad2016珊瑚What’s the future of the world’s coral reefs?世界珊瑚礁的未来是什么&#xff1f; In February of 2020, scientists at University of Hawaii Manoa released a study addressing this very question. The models they developed forecasted a 70–90% worl…

EChart中使用地图方式总结(转载)

EChart中使用地图方式总结 2018年02月06日 22:18:57 来源&#xff1a;https://blog.csdn.net/shaxiaozilove/article/details/79274772最近在仿照EChart公交线路方向示例&#xff0c;开发表示排水网和污水网流向地图&#xff0c;同时地图上需要叠加排放口、污染源、污水处理厂等…

android mvp模式

越来越多人讨论mvp模式&#xff0c;mvp在android应用开发中获得更多的重视&#xff0c;这里说一下对MVP的简单了解。 什么是 MVP? MVP模式使逻辑从视图层分开&#xff0c;目的是我们在屏幕上怎么表现&#xff0c;和界面如何工作的所有事情就完全分开了。 View显示数据&…

Node.js REPL(交互式解释器)

2019独角兽企业重金招聘Python工程师标准>>> Node.js REPL(交互式解释器) Node.js REPL(Read Eval Print Loop:交互式解释器) 表示一个电脑的环境&#xff0c;类似 Window 系统的终端或 Unix/Linux shell&#xff0c;我们可以在终端中输入命令&#xff0c;并接收系统…

用python进行营销分析_用python进行covid 19分析

用python进行营销分析Python is a highly powerful general purpose programming language which can be easily learned and provides data scientists a wide variety of tools and packages. Amid this pandemic period, I decided to do an analysis on this novel coronav…

Alpha冲刺第二天

Alpha第二天 1.团队成员 郑西坤 031602542 &#xff08;队长&#xff09; 陈俊杰 031602504陈顺兴 031602505张胜男 031602540廖钰萍 031602323雷光游 031602319苏芳锃 0316023302.项目燃尽图 3.项目进展 时间工作内容11月18日UI设计、初步架构搭建11月19日UI设计、服务器的进一…

水文分析提取河网_基于图的河网段地理信息分析排序算法

水文分析提取河网The topic of this article is the application of information technologies in environmental science, namely, in hydrology. Below is a description of the algorithm for ranking rivers and the plugin we implemented for the open-source geographic…