图论为什么这么难

Graph theory might sound like an intimidating and abstract topic to you, so why should you even spend your time reading an article about it? However, although it might not sound very applicable, there are actually an abundance of useful and important applications of graph theory! In this article, I will try to explain briefly what some of these applications are. In doing so, I will do my best to convince you that having at least some basic knowledge of this topic can be useful in solving some interesting problems you might come across.

图形理论对您来说听起来像是一个令人生畏的抽象话题,那么为什么还要花时间阅读有关它的文章? 但是,尽管听起来可能不太适用,但实际上图论有很多有用而重要的应用! 在本文中,我将尝试简要解释其中的一些应用程序。 为此,我将尽力说服您,至少具有该主题的一些基本知识对于解决您可能遇到的一些有趣问题很有用。

In this article, I will through a concrete example show how a route planning/optimization task can be formulated and solved using graph theory. More specifically, I will consider a large warehouse consisting of 1000s of different items in various locations/pickup points. The challenge here is, given a list of items, which path should you follow through the warehouse to pickup all items, but at the same time minimize the total distance traveled? For those of you familiar with these kind of problems, this has quite some resemblance to the famous traveling salesman problem. (A well known problem in combinatorial optimization, important in theoretical computer science and operations research).

在本文中,我将通过一个具体示例展示如何使用图论来制定和解决路线规划/优化任务。 更具体地说,我将考虑一个大型仓库,该仓库由位于不同位置/提货点的数千种不同物品组成。 这里的挑战是,给定一个物品清单,您应该沿着该路径走入仓库以拾取所有物品,但同时要使总行驶距离最小化? 对于那些熟悉这类问题的人来说,这与著名的旅行推销员问题非常相似。 ( 组合优化中的一个众所周知的问题,在理论计算机科学和运筹学中很重要)。

As you might have realized, the goal of this article is not to give a comprehensive introduction to graph theory (which would be quite a tremendous task). Through a real-world example, I will rather try to convince you that knowing at least some basics of graph theory can prove to be very useful!

您可能已经意识到,本文的目的不是全面介绍图论(这将是一项艰巨的任务)。 通过一个真实的例子,我宁愿说服您,至少了解图论的一些基础知识会证明是非常有用的!

I will start with a brief historical introduction to the field of graph theory, and highlight the importance and the wide range of useful applications in many vastly different fields. Following this more general introduction, I will then shift focus to the warehouse optimization example discussed above.

我将首先对图论领域进行简要的历史介绍,然后重点介绍在许多截然不同的领域中的重要性和广泛的有用应用。 在进行了更一般的介绍之后,我将把重点转移到上面讨论的仓库优化示例。

图论的历史 (The history of Graph Theory)

The basic idea of graphs were first introduced in the 18th century by the Swiss mathematician Leonhard Euler, one of the most eminent mathematicians of the 18th century (and of all time, really). His work on the famous “Seven Bridges of Königsberg problem”, are commonly quoted as origin of graph theory.

图的基本概念是由瑞士数学家莱昂哈德·欧拉 ( Leonhard Euler)于18世纪首次提出的, 莱昂哈德·欧拉 ( Leonhard Euler)是18世纪最杰出的数学家之一(实际上是有史以来)。 他关于著名的“ 柯尼斯堡七桥问题 ”的著作通常被认为是图论的起源。

The city of Königsberg in Prussia (now Kaliningrad, Russia) was set on both sides of the Pregel River, and included two large islands — Kneiphof and Lomse — which were connected to each other, or to the two mainland portions of the city, by seven bridges (as illustrated in the below figure to the left). The problem was to devise a walk through the city that would cross each of those bridges once and only once.

普鲁士的克尼格斯堡市(现为俄罗斯加里宁格勒)位于普雷格尔河的两侧,包括两个大岛,克奈普霍夫和隆塞,它们相互连接,或者与该市的两个大陆部分相连,七个桥(如下图左图所示)。 问题是要设计一条穿过城市的步行路线,一次只能穿过一次这些桥梁。

Euler, recognizing that the relevant constraints were the four bodies of land & the seven bridges, drew out the first known visual representation of a modern graph. A modern graph, as seen in bottom-right image, is represented by a set of points, known as vertices or nodes, connected by a set of lines known as edges.

欧拉认识到相关的约束条件是四块土地和七座桥梁,因此得出了现代图形的第一个已知视觉表示。 一个现代的曲线图,如在右下方图像,是由一组点,公知的为v ertices或节点,由一组被称为边缘线的连接来表示。

Wikipedia维基百科

This abstraction from a concrete problem concerning a city and bridges etc. to a graph makes the problem tractable mathematically, as this abstract representation includes only the information important for solving the problem. Euler actually proved that this specific problem has no solution. However, the difficulty he faced was the development of a suitable technique of analysis, and of subsequent tests that established this assertion with mathematical rigor. From there, the branch of math known as graph theory lay dormant for decades. In modern times, however, it’s applications are finally exploding.

从有关城市和桥梁等具体问题的抽象到图表,使该问题在数学上易于处理,因为这种抽象表示仅包含解决问题的重要信息。 欧拉实际上证明了这个特定问题没有解决方案。 但是,他面临的困难是开发一种合适的分析技术以及随后的测试,这些测试以严格的数学方法确立了这一主张。 从那里开始,数十年来一直处于Hibernate状态的称为图论的数学分支。 然而,在现代,它的应用终于爆炸了。

图论概论 (Introduction to Graph Theory)

As mentioned previously, I do not aim to give a comprehensive introduction to graph theory. The following section still contains some of the basics when it comes to different kind of graphs etc., which is of relevance to the example we will discuss later on path optimization.

如前所述,我并不打算对图论进行全面介绍。 以下部分仍包含有关不同种类的图等的一些基础知识,这与我们稍后将讨论路径优化的示例相关。

Graph Theory is ultimately the study of relationships. Given a set of nodes & connections, which can abstract anything from city layouts to computer data, graph theory provides a helpful tool to quantify & simplify the many moving parts of dynamic systems. Studying graphs through a framework provides answers to many arrangement, networking, optimization, matching and operational problems.

图论最终是对关系的研究。 给定一组节点和连接,可以抽象化从城市布局到计算机数据的所有内容,图论提供了一个有用的工具,可以量化和简化动态系统的许多移动部分。 通过框架研究图形可为许多布置,网络,优化,匹配和操作问题提供答案。

Graphs can be used to model many types of relations and processes in physical, biological, social and information systems, and has a wide range of useful applications such as e.g.

图形可用于对物理,生物,社会和信息系统中的许多类型的关系和过程进行建模,并且具有广泛的有用应用,例如

  1. Finding communities in networks, such as social media (friend/connection recommendations), or in the recent days for possible spread of COVID19 in the community through contacts.在社交媒体等网络中查找社区(朋友/关系推荐),或者在最近几天内通过联系在社区中传播COVID19。
  2. Ranking/ordering hyperlinks in search engines.在搜索引擎中对超链接进行排名/排序。
  3. GPS/Google maps to find the shortest path home.GPS / Google地图可找到最短路径。
  4. Study of molecules and atoms in chemistry.研究化学中的分子和原子。
  5. DNA sequencingDNA测序
  6. Computer network security计算机网络安全
  7. ….. and many more….….. 还有很多…。
A simple example of a graph with 6 nodes
具有6个节点的图的简单示例
WikimediaWikimedia

As mentioned, there are several types of graphs that describe different kind of problems (and the constraints within them). A nice walk-through of various types of graphs can also be found in a previous article by Kelvin Jose, and the below section represents a subset of that article.

如前所述,有几种类型的图描述了不同类型的问题(以及其中的约束)。 凯尔文·何塞 ( Kelvin Jose)的上一篇文章中也可以找到各种图形的很好的演练,下面的部分代表该文章的子集。

图的类型 (Types of Graphs)

There are different types of graph representations available and we have to make sure that we understand the kind of graph we are working with when programmatically solving a problem which includes graphs.

有不同类型的图表示形式,当以编程方式解决包括图的问题时,我们必须确保我们了解要使用的图的类型。

  • Undirected Graphs

    无向图

As the name shows, there won’t be any specified directions between nodes. So an edge from node A to B would be identical to the edge from B to A.

顾名思义,节点之间不会有任何指定的方向。 因此,从节点A到B 的边缘 从B到A的边缘 相同

In the above graph, each node could represent different cities and the edges show the bidirectional roads.

在上图中,每个节点可以代表不同的城市,边缘显示双向道路。

  • Directed Graphs (DiGraphs)

    有向图(DiGraphs)

Unlike undirected graphs, directed graphs have orientation or direction among different nodes. That means if you have an edge from node A to B, you can move only from A to B.

与无向图不同,有向图 在不同节点之间 具有方向或 方向 这意味着,如果从节点A到B有一条边,则只能从A移到B。

WIkiMediaWIkiMedia

Like the previous example, if we consider nodes as cities, we have a direction from city 1 to 2. That means, you can drive from city 1 to 2 but not back to city 1, because there is no direction back to city 1 from 2. But if we closely examine the graph, we can see cities with bi-direction. For example cities 3 and 4 have directions to both sides.

像前面的示例一样,如果我们将节点视为城市,则我们有一个从城市1到2的方向。这意味着,您可以从城市1到2行驶,但不能返回城市1,因为没有从该方向返回城市1的方向。 2.但是,如果我们仔细检查图表,我们会看到双向的城市。 例如,城市3和4向两侧都有方向。

  • Weighted Graphs

    加权图

Many graphs can have edges containing a weight associated to represent a real world implication such as cost, distance, quantity etc …

许多图的边缘可能包含权重,以表示真实世界的含义,例如成本,距离,数量等。

Credit: Estefania Cassingena Navone viafreecodecamp.org
图片来源 : Estefania Cassingena Navone通过freecodecamp.org

Weighted graphs could be either directed or undirected graph. The one we have in this example is an undirected weighted graph. The cost (or distance) from the green to the orange node (and vice versa) is 3. Like our previous example, if you want to travel between two cities, say city green and orange, we would have to drive 3 miles. These metrics are self-defined and could be changed according to the situations. For a more elaborated example, consider you have to travel to city pink from green. If you look at the city graph, we can’t find any direct roads or edges between the two cities. So what we can do is to travel via another city. The most promising routes would be starting from green to pink via orange and blue. If the weights are costs between cities, we would have to spend 11$ to travel via blue to reach pink but if we take the other route via orange, we would only have to pay 10$ for the trip.

加权图 可以是有向图或无向图。 在此示例中,我们得到的是无向加权图。 从绿色节点到橙色节点(反之亦然)的成本(或距离)为3。像我们前面的示例一样,如果您要在两个城市之间旅行,例如绿色和橙色,则必须行驶3英里。 这些指标是自定义的,可以根据情况进行更改。 对于更详细的示例,请考虑您必须从绿色到粉红色的城市。 如果您查看城市图,我们在两个城市之间找不到任何直接的道路或边缘。 因此,我们可以做的是穿越另一个城市。 最有希望的路线将是从绿色到粉红色,再到橙色和蓝色。 如果权重是城市之间的成本,那么我们将不得不花费11美元通过蓝色旅行到达粉红色,但是如果我们通过橙色乘坐另一条路线,那么我们只需为这次旅行支付10美元。

There may be several weights associated with each edge, including distance, travel time, or monetary cost. Such weighted graphs are commonly used to program GPS’s, and travel-planning search engines that compare flight times and costs.

每个边缘可能有多个权重,包括距离,行驶时间或金钱成本。 这样的加权图通常用于对GPS进行编程,并比较旅行时间和费用的旅行计划搜索引擎。

图论→路线优化 (Graph Theory → Route optimization)

Having (hopefully) convinced you that graph theory is worth knowing something about, it is now time to focus on our example case of route planning when picking items in our warehouse.

(希望)使您相信图论值得一读,现在是时候在我们的仓库中拣选项目时关注路线规划的示例案例。

挑战: (Challenge:)

The challenge here is that given a “picking list” as input, we should find the shortest route that passes all the pickup points, but also complies to the restrictions with regard to where it is possible/allowed to drive. The assumptions and constraints here are that crossing between corridors in the warehouse is only allowed at marked “turning points”. Also, the direction of travel must follow the specified legal driving direction for each corridor.

这里的挑战是,在输入“拣选清单”的情况下,我们应该找到经过所有拣选点的最短路线,而且还要遵守关于可能/允许行驶的地点的限制。 这里的假设和约束条件是,仅允许在标记的“转折点”处穿越仓库的走廊。 另外,每个走廊的行驶方向必须遵循指定的合法行驶方向。

解: (Solution:)

This problem can be formulated as an optimization problem in graph theory. All pickup points in the warehouse form a “node” in the graph, where the edges represent permitted lanes/corridors and distances between the nodes. To introduce the problem more formally, let us start from a simplified example.

这个问题可以用图论的形式表达为优化问题。 仓库中的所有取货点都在图中形成一个“节点”,其边缘表示允许的车道/走廊以及节点之间的距离。 为了更正式地介绍这个问题,让我们从一个简化的例子开始。

The graph below represents 2 corridors with 5 shelves/pickup-points per corridor. All shelves are here represented as a node in the graph, with an address ranging from 1–10. The arrows indicate the permitted driving direction, where the double arrows indicate that you can drive either way. Simple enough, right?

下图显示了2条走廊,每个走廊有5个搁板/拾取点。 在此,所有架子都表示为图中的节点,地址范围为1-10。 箭头指示允许的行驶方向,双箭头指示您可以两种方式行驶。 很简单,对不对?

Being able to represent the permitted driving routes in the form of a graph, means that we can use mathematical techniques known from graph theory to find the optimal “driving route” between the nodes (i.e., the stock shelves in our warehouse).

能够以图形的形式表示允许的行驶路线,这意味着我们可以使用图形理论中已知的数学技术来找到节点(即,我们仓库中的货架)之间的最佳“行驶路线”。

The example graph above can be described mathematically through an «adjacency matrix». The adjacency matrix to the right in the below figure is thus a representation of our «warehouse graph», which indicates all permitted driving routes between the various nodes.

上面的示例图可以通过《 邻接矩阵 》进行数学描述。 因此,下图右侧的邻接矩阵是我们“仓库图”的表示,该图表示各个节点之间所有允许的行驶路线。

  • Example 1: You are allowed to travel from node 2 → 3, but not from 3 → 2. This is indicated by the “1” in the adjacency matrix to the right.

    示例1:允许您从节点2→3出发,但不能从3→2出发。这由右侧邻接矩阵中的“ 1”指示。

  • Example 2: You are allowed to go from both node 8 → 3, and from 3 → 8, again indicated by the “1”`s in the adjacency matrix (which in this case is symmetric when it comes to travel direction).

    示例2:允许您从节点8→3和3→8出发,再次由邻接矩阵中的“ 1”表示(在这种情况下,关于行驶方向是对称的)。

回到我们的仓库问题: (Back to our warehouse problem:)

A real warehouse is of course bigger and more complex than the above example. However, the main principles of how to represent the problem through a graph remains the same. To make the real problem slightly simpler (and more visually suitable for this article), I have reduced the total number of shelves/pickup-points (approximately every 50th shelf included, marked with black squares in the below figure). All pickup points are given an address (“node number”) from 1–74. The other relevant constraints mentioned earlier, such as permitted driving directions in each of the corridors, as well as the allowed “turning points” and shortcuts between the corridors are also indicated in the figure..

实际的仓库当然比上面的示例更大,更复杂。 但是,如何通过图形表示问题的主要原理保持不变。 为了使实际问题更简单(并且更直观地适合本文),我减少了架子/拾取点的总数(大约每50个架子中有一个,在下图中用黑色正方形标记)。 将为所有拾取点分配一个1到74之间的地址(“节点号”)。 图中还标出了前面提到的其他相关约束,例如每个走廊中的允许行驶方向以及走廊之间的允许“转弯点”和捷径。

Graph representation of our simplified warehouse
我们简化仓库的图形表示

The next step is then to represent this graph in the form of a adjacency matrix. Since we are here interested in finding both the optimal route and total distance, we must also include the driving distance between the various nodes in the matrix.

然后,下一步就是以邻接矩阵的形式表示该图。 由于我们对寻找最佳路线和总距离感兴趣,因此我们还必须在矩阵中包括各个节点之间的行驶距离。

Adjacency matrix for the “warehouse graph”
“仓库图”的邻接矩阵

This matrix indicates all constraints with regard to both the permitted direction of travel, which “shortcuts” are permitted, any other restrictions as well as the driving distance between the nodes (illustrated through the color). As an example, the “shortcut” between nodes 21 and 41 shown in the graph representation can clearly be identified also in the adjacency matrix. The “white areas” of the matrix represents the paths that are not allowed, indicated through an “infinite” distance between those nodes.

该矩阵指示关于允许的行进方向(允许使用“快捷方式”),所有其他限制以及节点之间的行驶距离(通过颜色显示)的所有限制。 作为示例,在图形表示中所示的节点21和41之间的“快捷方式”也可以在邻接矩阵中清楚地识别。 矩阵的“白色区域”表示不允许的路径,通过这些节点之间的“无限”距离表示。

从图表示到路径优化 (From graph representation to path optimization)

Just having an abstracted representation of our warehouse in the form of a graph, does of course not solve our actual problem. The idea is rather that through this graph representation, we can now use the mathematical framework and algorithms from graph theory to solve it!

仅仅以图表的形式对我们的仓库进行抽象表示,当然并不能解决我们的实际问题。 想法是通过这种图形表示,我们现在可以使用图形理论中的数学框架和算法来解决它!

Since graph optimization is a well-known field in mathematics, there are several methods and algorithms that can solve this type of problem. In this example case, I have based the solution on the “Floyd-Warshall algorithm”, which is a well known algorithm for finding shortest paths in a weighted graph. A single execution of the algorithm will find the lengths (summed weights) of shortest paths between all pairs of nodes. Although it does not return details of the paths themselves, it is possible to reconstruct the paths with simple modifications to the algorithm.

由于图优化是数学领域的众所周知的领域,因此有几种方法和算法可以解决此类问题。 在此示例情况下,我基于“ Floyd-Warshall算法 ”解决方案,这是一种用于在加权图中找到最短路径的众所周知的算法 。 算法的一次执行将找到所有节点对之间最短路径的长度(总权重)。 尽管它不返回路径本身的详细信息,但可以通过对算法的简单修改来重建路径。

If you give this algorithm as input a “picking order list” where you go through a list of items you want to pick, you should then be able to obtain the optimal route which minimize the total driving distance to collect all items on the list.

如果您将此算法作为输入输入“领料单列表”,然后在该列表中浏览要领料的物品列表,则应该能够获得最佳路线,该路线将使总行驶距离最小化以收集清单上的所有物品。

Example: Let us start by visualizing the results for a (short) picking list as follows: Start from node «0», pick up items at location/node 15, 45, 58 and 73 (where these locations are illustrated in the figure below). The algorithm finds the shortest allowable route between these points through calculating the “distance matrix”, D, which can then be used to determine the total driving distance between all locations/nodes in the picking list.

示例:让我们首先以可视化方式显示一个(简短的)拣货清单,如下所示:从节点«0»开始,在位置/节点15、45、58和73处拣货(这些位置如下图所示) )。 该算法通过计算“距离矩阵” D找到这些点之间的最短允许路线,然后将其用于确定领料单中所有位置/节点之间的总行驶距离。

  • Step 1: D[0][15] → 90 m

    步骤1: D [0] [15]→90 m

  • Step 2: D[15][45] →52 m

    步骤2: D [15] [45]→52 m

  • Step 3: D[45][58] → 34 m

    步骤3: D [45] [58]→34 m

  • Step 4: D[58][73] → 92 m

    步骤4: D [58] [73]→92 m

Total distance = 268m

总距离= 268m

Optimized driving route from picking list
从拣货清单优化驾驶路线

Have tested several “picking lists” as input and verifying the proposed driving routes and calculated distance, the algorithm has been able to find the optimal route in all cases. The algorithm respects all the imposed constraints, such as the permitted direction of travel, and uses all permitted “shortcuts” to minimize the total distance.

测试了多个“拣选清单”作为输入,并验证了建议的行驶路线和计算出的距离,该算法已能够在所有情况下找到最佳路线。 该算法遵守所有强加的约束条件,例如允许的行进方向,并使用所有允许的“快捷方式”来最小化总距离。

从路径优化到有用的见解 (From path optimization to useful insights)

As shown through the above example, we have developed an optimization algorithm that calculates the optimal driving route via all points on a picking order list (for a simplified version of the warehouse). By providing a list of picking orders as input, one can thus relatively easily calculate statistics on typical mileage per. picking order. These statistics can then also be filtered on various information such as item type, customer, date, etc. In the following section, I have thus picked a few examples on how one can extract interesting statistics from such a path optimization tool.

如上面的示例所示,我们开发了一种优化算法,该算法可通过拣货订单列表上的所有点(针对仓库的简化版本)计算最佳行驶路线。 通过提供一列提货单作为输入,因此可以相对轻松地计算出每人平均行驶里程的统计数据。 领料单。 然后,还可以根据各种信息(例如项目类型,客户,日期等)过滤这些统计信息。因此,在以下部分中,我选择了一些示例,说明如何从这种路径优化工具中提取有趣的统计信息。

In doing this, I first generated 10.000 picking order lists where the number of items per list ranges from 1–30 items, located at random pickup points in the warehouse (address 3–74 in the figure above). By performing the path optimization procedure over all these picking list, we can then extract some interesting statistics.

为此,我首先生成了10.000个拣货订单清单,其中每个清单的物品数量在1至30件之间,位于仓库中的随机取货点(上图中的地址3–74)。 通过对所有这些选择列表执行路径优化过程,我们可以提取一些有趣的统计信息。

Example 1: Calculate mileage as a function of the number of units per. picking order list. Here, you would naturally assume that the total mileage increases the more items you have to pick. But, at some level, this will start to flatten out. This is due to the fact that one eventually has to stop by all the corridors in the warehouse to pick up goods, which then prevents us from making use of clever “shortcuts” to minimize the total driving distance. This tendency can be illustrated in the figure below to the left, which illustrates that for more than approximately 15–20 units per picking order, adding extra items does not make the total mileage much longer (as you have to drive through all corridors of the warehouse anyway). Note that the figures show a “density plot” of the distribution of typical mileage per. picking orders list

示例1:根据每单位数量计算里程。 领料单清单。 在这里,您自然会假设总里程数增加了您必须选择的项目。 但是,在某种程度上,这将开始趋于平缓。 这是由于这样一个事实,即最终必须在仓库的所有走廊停下来取货,这又使我们无法利用巧妙的“捷径”来最小化总行驶距离。 这种趋势可以在左下图中说明,该图说明,对于每个拣配订单,大约15-20个单位以上,添加额外的物品并不会使总行驶里程更长(因为您必须开车穿过货车的所有走廊)仓库)。 注意,这些图显示了每英里典型行驶里程分布的“密度图”。 领料单清单

Another interesting statistic, which shows the same trend, is the distribution of driving distance per picked item in the figure to the right. Here, we see that for picking lists with few items, the typical mileage per. item is relatively high (with a large variance, depending on how “lucky” we are with some items being located in the same corridor etc.). For picking lists with several items though, the mileage per. item is gradually decreasing. This type of statistic can thus be interesting to investigate closer, in order to optimize how many items each picking order list should contain in order to minimize the mileage per picked item.

另一个有趣的统计数字,显示了相同的趋势,是右图中每个被拾取项目的行驶距离分布。 在这里,我们看到,对于拣选清单少的物品,每英里的典型行驶里程。 物品相对较高(差异很大,取决于一些物品位于同一走廊等情况下的“幸运”程度)。 对于带有多个项目的拣货清单,每英里的里程数。 项目正在逐渐减少。 因此,为了进一步优化每个拣货订单列表应包含的物品数量,以使每个拣选物品的里程数最小化,这种统计数据可能会更有趣地进行深入研究。

Estimating driving distance per list/item vs. number of items per list.
估算每个列表/项目的行驶距离与每个列表的项目数。

Example 2: Here I have used real-world data that also contains additional information in the form of a customer ID (here shown for only two customers). We can then take a closer look at the distribution in mileage per. picking order list for the two customers. For example, do you typically have to drive longer distances to pick the goods of one customer versus another? And, should you charge that customer extra for this additional cost?

示例2:在这里,我使用了真实数据,其中还包含客户ID形式的附加信息(此处仅针对两个客户显示)。 然后,我们可以仔细查看每公里里程的分布。 挑选两个客户的订单清单。 例如,您通常需要开车较长距离来挑选一位客户与另一位客户的商品吗? 而且,您是否应该向该客户额外收取这笔额外费用?

The below figure to the left shows the distribution in mileage for «Customer 1» and «Customer 2» respectively. One of the things we can interpret from this is that for customer 2, most picking order lists have a noticeably shorter driving distance compared to customer 1. This can also be shown by calculating the average mileage per. picking order list for the two customers (figure to the right).

左下图分别显示了“客户1”和“客户2”的里程分布。 我们可以从中得出的解释之一是,对于客户2,大多数拣货订单列表的行驶距离比客户1短得多。这也可以通过计算每人的平均里程来显示。 两个客户的拣货订单清单(右图)。

This type of information can e.g. be used to implement pricing models where the product price to the customer is also based on mileage per order. For customers where the order involves more driving (and thus also more time and higher cost) you can consider invoicing extra compared to orders that involve short driving distances.

此类信息可以例如用于实施定价模型,其中对客户的产品价格也基于每个订单的里程。 对于订单涉及更多驾驶(因此也需要更多时间和更高成本)的客户,您可以考虑比涉及短途驾驶距离的订单多开票。

摘要: (Summary:)

In the end, I hope I have convinced you that graph theory is not just some abstract mathematical concept, but that it actually has many useful and interesting applications! Hopefully, the examples above will be useful for some of you in solving similar problems later, or at least satisfy some of your curiosity when it comes to graph theory and some of its applications.

最后,我希望我已经说服了您,图论不仅是一些抽象的数学概念,而且它实际上具有许多有用且有趣的应用程序! 希望上面的示例对某些人在以后解决类似问题时很有用,或者至少满足您对图论及其某些应用的好奇。

The cases discussed in the article covers just a few examples that illustrate some of the possibilities that exist. If you have previous experience and ideas on the topic, it would be interesting to hear your thoughts in the comments below!

本文讨论的案例仅涵盖了一些示例,这些示例说明了存在的一些可能性。 如果您以前有关于该主题的经验和想法,那么在下面的评论中听听您的想法会很有趣!

Did you find the article interesting? If so, you might also like some of my other articles on topics such as AI, Machine Learning, physics, etc., which you can find here: https://medium.com/@vflovik

您觉得这篇文章有趣吗? 如果是这样,您可能还会喜欢我的其他一些有关AI,机器学习,物理等主题的文章,您可以在这里找到: https : //medium.com/@vflovik

翻译自: https://towardsdatascience.com/what-is-graph-theory-and-why-should-you-care-28d6a715a5c2

图论为什么这么难


http://www.taodudu.cc/news/show-863406.html

相关文章:

  • 使用RNN和TensorFlow创建自己的Harry Potter短故事
  • bitnami如何使用_使用Bitnami获取完全配置的Apache Airflow Docker开发堆栈
  • cox风险回归模型参数估计_信用风险管理:分类模型和超参数调整
  • 支持向量机 回归分析_支持向量机和回归分析
  • ai/ml_您本周应阅读的有趣的AI / ML文章(8月15日)
  • chime-4 lstm_CHIME-6挑战赛回顾
  • 文本文件加密和解密_解密文本见解和相关业务用例
  • 有关糖尿病模型建立的论文_预测糖尿病结果的模型比较
  • chi-squared检验_每位数据科学家都必须具备Chi-S方检验统计量:客户流失中的案例研究
  • 深度学习:在图像上找到手势_使用深度学习的人类情绪和手势检测器:第2部分
  • 爆破登录测试网页_预测危险的地震爆破第一部分:EDA,特征工程和针对不平衡数据集的列车测试拆分
  • 概率论在数据挖掘_为什么概率论在数据科学中很重要
  • 集合计数 二项式反演_对计数数据使用负二项式
  • 使用TorchElastic训练DeepSpeech
  • 神经网络架构搜索_神经网络架构
  • raspberry pi_通过串行蓝牙从Raspberry Pi传感器单元发送数据
  • 问答机器人接口python_设计用于机器学习工程的Python接口
  • k均值算法 二分k均值算法_如何获得K均值算法面试问题
  • 支持向量机概念图解_支持向量机:基本概念
  • 如何设置Jupiter Notebook服务器并从任何地方访问它(Windows 10)
  • 无监督学习 k-means_监督学习-它意味着什么?
  • logistic 回归_具有Logistic回归的优秀初学者项目
  • 脉冲多普勒雷达_是人类还是动物? 多普勒脉冲雷达和神经网络的目标分类
  • pandas内置绘图_使用Pandas内置功能探索数据集
  • sim卡rfm_信用卡客户的RFM集群
  • 需求分析与建模最佳实践_社交媒体和主题建模:如何在实践中分析帖子
  • 机器学习 数据模型_使用PyCaret将机器学习模型运送到数据—第二部分
  • 大数据平台蓝图_数据科学面试蓝图
  • 算法竞赛训练指南代码仓库_数据仓库综合指南
  • 深度学习 图像分类_深度学习时代您应该阅读的10篇文章了解图像分类

图论为什么这么难_图论是什么,为什么要关心?相关推荐

  1. 图论算法 最短路程_图论与图学习(二):图算法

    选自towardsdatascience 作者:Maël Fabien 机器之心编译 参与:熊猫 图(graph)近来正逐渐变成机器学习的一大核心领域,比如你可以通过预测潜在的连接来理解社交网络的结构 ...

  2. 静息态fMRI+图论研究:难治性精神分裂症的脑功能网络

    <本文同步发布于"脑之说"微信公众号,欢迎搜索关注~~> 笔者比较关注精神疾病脑功能网络的变化特征,因此,最近都在看相关的文献.本次,笔者就给大家分享一篇相关的论文,该 ...

  3. 图论基础知识_图论基础

    图论基础知识 In this article, we'll touch upon the graph theory basics. Graph Theory is a branch of mathem ...

  4. 离散数学图论旅行规划问题_《图论及其应用》(一)

    点击返回目录 一. 定义 1.1 图的基本概念 图或有序对或序偶(P1).有限图/平凡图/非平凡图/空图(P1).顶点数或阶数/边数/重数/重边/环(P1).简单图/复合图(P1).相邻(P2).相关 ...

  5. 数据结构实验之图论四:迷宫探索_用图机器学习探索 A 股个股相关性变化

    在本系列的前文 [1,2]中,我们介绍了如何使用 Python 语言图分析库 NetworkX [3] + Nebula Graph [4] 来进行中人物关系图谱分析. 在本文中我们将介绍如何使用 J ...

  6. neo4j python 算法_图论与图学习(二):图算法

    选自towardsdatascience 作者:Maël Fabien机器之心编译参与:熊猫 图(graph)近来正逐渐变成机器学习的一大核心领域,比如你可以通过预测潜在的连接来理解社交网络的结构.检 ...

  7. 数据结构实验之图论四:迷宫探索_迷宫搜索类的双向bfs问题(例题详解)

    前言 文章若有疏忽还请指正! 更多精彩还请关注公众号:bigsai 头条号:一直码农一直爽 在搜索问题中,以迷宫问题最具有代表性,无论是八皇后的回溯问题,还是dfs找出口,bfs找最短次数等等题目的问 ...

  8. 图论算法 最短路程_从网页排序看图论的重要应用

    从网页排序|看图论的重要应用 图,是什么? 现实生活中很多问题都可以用图进行描述, 如网络流.资源分配.电路优化.网页排序.搜索.工序安排等等. 同时, 图也是描述许多数据结构的重要手段, 如树结构是 ...

  9. 握手引理_图论中的握手引理–握手定理

    握手引理 Hello Everyone, 大家好, Today we will see Handshaking lemma associated with graph theory. Before s ...

最新文章

  1. 解决Android Stadio 导入Android 项目,没有可运行的Module
  2. 用 Flask 来写个轻博客 (25) — 使用 Flask-Principal 实现角色权限功能
  3. Hdoj 1846.Brave Game 题解
  4. 比特币的区块结构解析
  5. 使用html css js实现计算器
  6. 如何设置win7系统分辨率
  7. 动态数组vector的使用_简单代码示例
  8. ssd训练自己数据集
  9. java与模式孙悟空_悟空模式-java-工厂方法模式
  10. 支持pygame的python有哪些版本_完整构建文件支持PYGAME
  11. 服务不支持chkconfig
  12. 店庆遇上双11,买书的最大优惠来了!
  13. web性能优化的一些方法
  14. 高分3号介绍及PIE使用
  15. Golang获取时间戳并增加一天
  16. Qt5开发的验厂考勤工资系统-计时计件综合版
  17. [系统安全] 五.OllyDbg和Cheat Engine工具逆向分析植物大战僵尸游戏
  18. 对于软件,我是认真的
  19. Flask模板中可以直接访问的特殊变量和方法
  20. mysql生成uui mybatis_Mybatis【配置文件】详解

热门文章

  1. [Oracle运维工程师手记] 如何从trace 文件,判断是否执行了并行
  2. 函数式编程笔记 01
  3. python实例[判断操作系统类型]
  4. php安装event扩展的问题
  5. 函数式编程的兴衰与当前之崛起
  6. 项目中SQL语句文件保存及提取方法
  7. express 框架之 路由与中间件
  8. 《篡权的ss》-linux命令五分钟系列之三十一
  9. Linux 指令大全(3)
  10. 下拉列表与多选框以及GridView中的多选框的问题