{"id":4312,"date":"2017-08-19T01:00:00","date_gmt":"2017-08-18T17:00:00","guid":{"rendered":"http:\/\/swarma.org\/%swarma-paper%\/"},"modified":"2018-12-05T22:01:10","modified_gmt":"2018-12-05T14:01:10","slug":"flownetwork%ef%bc%9a%e6%b5%81%e7%bd%91%e7%bb%9c%e7%9a%84%e5%bc%80%e6%ba%90python%e5%8c%85","status":"publish","type":"post","link":"https:\/\/swarma.org\/?p=4312","title":{"rendered":"Flownetwork\uff1a\u6d41\u7f51\u7edc\u7684\u5f00\u6e90Python\u5305"},"content":{"rendered":"<div class=\"bpp-post-content\">\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\" ><span style=\"font-size: 14px;\"><img  class=\"\"    style=\"letter-spacing: 0.5px; text-align: center; white-space: normal; border-width: 0px; border-style: initial; border-color: initial; cursor: default; width: 98%; height: auto !important;\" src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma2-1534232016.png\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/span><\/p>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\"><span style=\"font-size: 14px;\">\u5f00\u653e\u7684\u6d41\u7f51\u7edc\uff08Open Flow Network\uff09\uff0c\u6216\u6d41\u52a8\u7f51\u7edc\uff0c\u4e5f\u7b80\u79f0\u6d41\u7f51\u7edc(Flow Network)\u662f\u6307\u4e00\u7c7b\u7279\u6b8a\u7684\u52a0\u6743\u6709\u5411\u7684\u590d\u6742\u7f51\u7edc\u3002\u5176\u4e2d\uff0c\u6709\u5411\u8fde\u8fb9\u8868\u793a\u80fd\u91cf\u3001\u7269\u8d28\u3001\u8d27\u5e01\u3001\u4fe1\u606f\u3001\u6ce8\u610f\u529b\u7b49\u6d41\u52a8\u7684\u65b9\u5411\uff0c\u8fde\u8fb9\u7684\u6743\u91cd\u5219\u8868\u793a\u6d41\u91cf\u3002\u5f00\u653e\u6027\u4f53\u73b0\u4e3a\u7f51\u7edc\u4e2d\u5b58\u5728\u7740\u6e90\u548c\u6c47\u4e24\u7c7b\u7279\u6b8a\u7684\u8282\u70b9\u4ee3\u8868\u73af\u5883\u3002\u76ee\u524d\uff0c\u5f00\u653e\u6d41\u7f51\u7edc\u8fd9\u79cd\u6a21\u578b\u5df2\u7ecf\u88ab\u5e94\u7528\u5230\u4e86\u751f\u6001\u80fd\u91cf\u6d41\u5206\u6790\u3001\u56fd\u9645\u8d38\u6613\u6d41\u5206\u6790\u3001\u6295\u5165\u4ea7\u51fa\u5173\u7cfb\u3001\u5927\u89c4\u6a21\u7684\u4eba\u7c7b\u884c\u4e3a\u3001\u96c6\u4f53\u6ce8\u610f\u529b\u6d41\u7b49\u591a\u4e2a\u5b66\u79d1\u80cc\u666f\u4e2d\u53bb\u4e86\u3002<br  \/><\/span><\/p>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\"><inherit><span style=\"font-size: 14px;\">\u5357\u4eac\u5927\u5b66\u7684\u738b\u6210\u519b\u8001\u5e08\u548c\u829d\u52a0\u54e5\u5927\u5b66\u7684\u5434\u4ee4\u98de\u535a\u58eb\u5f00\u53d1\u4e86\u4e00\u4e2a\u5f00\u6e90\u5de5\u5177\u5305Flownetwork\uff0c\u5c06\u5e38\u7528\u7684\u8ba1\u7b97\u90fd\u96c6\u6210\u5230\u4e86\u4e00\u8d77\u3002\u521d\u5b66\u8005\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\u8be5\u5305\u5b8c\u6210\u5404\u79cd\u6709\u5173\u5f00\u653e\u6d41\u7f51\u7edc\u7684\u8ba1\u7b97\u3002<\/span><\/inherit><\/p>\n<div class=\"post-image\"><img    class=\"\"   src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma0-1534232017.png\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/div>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\"><span style=\"font-size: 14px;\">\u8be5\u5305\u7684\u4e3b\u8981\u529f\u80fd\u5982\u4e0b\uff1ahttps:\/\/github.com\/chengjun\/flownetwork\uff08\u6216\u70b9\u51fb\u9605\u8bfb\u539f\u6587\uff09<\/span><\/p>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\"><span style=\"font-size: 14px;\"><\/span><\/p>\n<section class=\"mpa-template\"   >\n<section style=\"margin-top: 20px;display: -webkit-box;display: flex;-webkit-box-pack: center;justify-content: center;-webkit-box-align: center;align-items: center;\" >\n<section style=\"width: 35px;height: 35px;\" >\n<section style=\"width: 100%; height: 100%; display: flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; border-radius: 50%; border-width: 1px; border-style: solid; border-color: rgb(105, 13, 3);\" >\n<section style=\"background-color: rgb(105, 13, 3); padding: 5px; color: rgb(255, 255, 255); width: 80%; height: 80%; border-radius: 50%; font-size: 14px; line-height: 20px; text-align: center;\" ><span style=\"font-size: 14px;\">1<\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px; text-align: center;\"><span style=\"color: rgb(123, 12, 0); font-size: 14px;\"><strong><span style=\"color: rgb(123, 12, 0); font-size: 16px;\">\u64cd\u4f5c\u6f14\u793a<\/span><\/strong><\/span><\/p>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\"><span style=\"font-size: 14px;\">\u9996\u5148\u9700\u8981\u5b89\u88c5flownetwork\u7684\u5305\uff0c\u6253\u5f00\u4e00\u4e2a\u7ec8\u7aef\u8f93\u5165\uff1a<\/span><\/p>\n<section  class=\"mpa-template\">\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">pip install flownetwork<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\"><span style=\"font-size: 14px;\">\u7136\u540e\u53ef\u4ee5\u5728jupyter notebook\uff08\u6216\u8005\u5176\u4ed6\u7684\u5730\u65b9\uff09\u4e2d\u5bfc\u5165\u5b89\u88c5\u5305\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"># import packages  from flownetwork import flownetwork as fn import networkx as nx import matplotlib.pyplot as plt  print(fn.__version__)<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\"><span style=\"font-size: 14px;\"><strong>\u7136\u540e\u8fdb\u884c\u6ce8\u610f\u529b\u7f51\u7edc\u7684\u5206\u6790\uff1a<\/strong><\/span><\/p>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\"><span style=\"font-size: 14px;\">\u9996\u5148\u6211\u4eec\u53ef\u4ee5\u7528help\u8bed\u53e5\u6765\u67e5\u770b\u4e00\u4e0b\u8fd9\u4e2a\u6d41\u7f51\u7edc\u7684\u7ed3\u6784\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">help(fn.constructFlowNetwork)<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; text-size-adjust: auto; -webkit-text-stroke-width: 0px; margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">Help on function constructFlowNetwork in module flownetwork.flownetwork: constructFlowNetwork(C)  &nbsp; C is an array of two dimentions, e.g.,  &nbsp; C = np.array([[user1, item1],  &nbsp; &nbsp; &nbsp;[user1, item2],  &nbsp; &nbsp; &nbsp;[user2, item1],  &nbsp; &nbsp; &nbsp;[user2, item3]])  &nbsp; Return a balanced flow networ<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u5728\u4e86\u89e3\u4e86\u8fd9\u4e2a\u7f51\u7edc\u7684\u67b6\u6784\u4e4b\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u81ea\u5df1\u521b\u5efa\u4e00\u4e2a\u6d41\u7f51\u7edc\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">demo = fn.attention_data gd = fn.constructFlowNetwork(demo)<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u4e3a\u4e86\u66f4\u597d\u7684\u4e86\u89e3\u8fd9\u4e2a\u6d41\u7f51\u7edc\u7684\u7ed3\u6784\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528matplotlib\u753b\u51fa\u8fd9\u4e2ademo\u7684\u6d41\u7f51\u7edc\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"># drawing a demo network fig = plt.figure(figsize=(12, 8),facecolor='white') pos={0: np.array([ 0.2 , &nbsp;0.8]),  2: np.array([ 0.2, &nbsp;0.2]),  1: np.array([ 0.4, &nbsp;0.6]),  6: np.array([ 0.4, &nbsp;0.4]),  4: np.array([ 0.7, &nbsp;0.8]),  5: np.array([ 0.7, &nbsp;0.5]),  3: np.array([ 0.7, &nbsp;0.2 ]),  'sink': np.array([ 1, &nbsp;0.5]), 'source': np.array([ 0, &nbsp;0.5])} width=[float(d['weight']*1.2) for (u,v,d) in gd.edges(data=True)]  edge_labels=dict([((u,v,),d['weight']) for u,v,d in gd.edges(data=True)])nx.draw_networkx_edge_labels(gd,pos,edge_labels=edge_labels, font_size = 15, alpha = .5)  nx.draw(gd, pos, node_size = 3000, node_color = 'orange',  alpha = 0.2, width = width, edge_color='orange',style='solid') nx.draw_networkx_labels(gd,pos,font_size=18)  plt.show()<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\"><span style=\"font-size: 14px;\">\u7136\u540e\u6211\u4eec\u5c31\u753b\u51fa\u4e86\u8fd9\u4e2ademo\u7684\u6d41\u7f51\u7edc\u56fe\uff1a<\/span><\/p>\n<p style=\"margin: 10px 0em; white-space: normal; line-height: 2em; letter-spacing: 0.5px;\"><img    class=\"\"   src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma6-1534232017.jpg\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/p>\n<section class=\"mpa-template\"   >\n<p style=\"clear: both; min-height: 1em; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\"><span style=\"font-size: 14px;\">\u5229\u7528\u4e0b\u9762\u8fd9\u6761\u8bed\u53e5\uff0c\u6211\u4eec\u67e5\u770b\u4e00\u4e0b\u8fd9\u4e2ademo\u7684\u4e00\u4e9b\u4fe1\u606f\uff1a<\/span><inherit style=\"margin: 0px; padding: 0px;\"><\/inherit><\/p>\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">nx.info(gd)<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u5982\u679c\u7f51\u7edc\u6ca1\u6709\u8fbe\u5230\u5e73\u8861\u7684\u8bdd\uff0c\u6211\u4eec\u5c31\u5bf9\u7f51\u7edc\u8fdb\u884c\u6d41\u5e73\u8861\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"># balancing the network # if it is not balanced  gh = fn.flowBalancing(cd) nx.info(gh)<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u8ba1\u7b97\u7f51\u7edc\u7684\u6d41\u77e9\u9635\uff0c\u5b58\u50a8\u5728m\u4e2d\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"><span style=\"font-size: 14px;\"># flow matrix<br  \/>m = fn.getFlowMatrix(gd)  m<\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u8f93\u51fa\u7684\u6d41\u77e9\u9635\u7684\u4fe1\u606f\u662f\u4e0b\u9762\u8fd9\u6837\u5b50\u7684\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"border-collapse: separate; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: rgb(51, 51, 51); font-family: Helvetica, arial, freesans, clean, sans-serif; line-height: 22px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">matrix([[ 0., &nbsp;1., &nbsp;0., &nbsp;0., &nbsp;3., &nbsp;1., &nbsp;0., &nbsp;0., &nbsp;0.],  &nbsp; [ 0., &nbsp;0., &nbsp;3., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0.],  &nbsp; [ 0., &nbsp;0., &nbsp;0., &nbsp;2., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;2.],  &nbsp; [ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;2.],  &nbsp; [ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;1., &nbsp;0., &nbsp;0., &nbsp;2.],  &nbsp; [ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;2.],  &nbsp; [ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;1.],  &nbsp; [ 5., &nbsp;2., &nbsp;1., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;1., &nbsp;0., &nbsp;0.],  &nbsp; [ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0.]])<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u8ba1\u7b97\u7f51\u7edc\u7684\u9a6c\u5c14\u79d1\u592b\u77e9\u9635\uff1a<br  \/><\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"><span style=\"font-size: 14px;\">fn.getMarkovMatrix(m)<\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u8f93\u51fa\u7684\u9a6c\u5c14\u79d1\u592b\u77e9\u9635\u662f\u4e0b\u5217\u6570\u7ec4\u7684\u5f62\u5f0f\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"><span style=\"font-size: 14px;\">array([[ 0., &nbsp;0.2 &nbsp; , &nbsp;0., &nbsp;0., &nbsp;0.6 &nbsp; ,0.2 &nbsp; , &nbsp;0., &nbsp;0., &nbsp;0.],  &nbsp;[ 0., &nbsp;0., &nbsp;1., &nbsp;0., &nbsp;0.,0., &nbsp;0., &nbsp;0., &nbsp;0.],  &nbsp;[ 0., &nbsp;0., &nbsp;0., &nbsp;0.5 &nbsp; , &nbsp;0.,0., &nbsp;0., &nbsp;0., &nbsp;0.5 &nbsp; ],  &nbsp;[ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0.,0., &nbsp;0., &nbsp;0., &nbsp;1.],  &nbsp;[ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0.,0.33333333, &nbsp;0., &nbsp;0., &nbsp;0.66666667],  &nbsp;[ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0.,0., &nbsp;0., &nbsp;0., &nbsp;1.],  &nbsp;[ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0.,0., &nbsp;0., &nbsp;0., &nbsp;1.],  &nbsp;[ 0.55555556, &nbsp;0.22222222, &nbsp;0.11111111, &nbsp;0., &nbsp;0.,0., &nbsp;0.11111111, &nbsp;0., &nbsp;0.],  &nbsp;[ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0.,0., &nbsp;0., &nbsp;0., &nbsp;0.]])<\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u63a5\u7740\u6211\u4eec\u8ba1\u7b97\u65e0\u7a77\u6b65\u957f\u7684\u7d2f\u79ef\u9a6c\u5c14\u79d1\u592b\u8f6c\u79fb\u77e9\u9635\uff1a<br  \/><\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"><span style=\"font-size: 14px;\">fn.getUmatrix(gd)<\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u8f93\u51fa\u7684\u77e9\u9635\u662f\u4e0b\u9762\u8fd9\u4e2a\u6837\u5b50\u7684\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"><span style=\"font-size: 14px;\">matrix([[ 1., &nbsp;0.2 &nbsp; , &nbsp;0.2 &nbsp; , &nbsp;0.1 &nbsp; , &nbsp;0.6 &nbsp; ,0.4 &nbsp; , &nbsp;0.], [ 0., &nbsp;1., &nbsp;1., &nbsp;0.5 &nbsp; , &nbsp;0.,0., &nbsp;0.], [ 0., &nbsp;0., &nbsp;1., &nbsp;0.5 &nbsp; , &nbsp;0.,0., &nbsp;0.], [ 0., &nbsp;0., &nbsp;0., &nbsp;1., &nbsp;0.,0., &nbsp;0.], [ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;1.,0.33333333, &nbsp;0.], [ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0.,1., &nbsp;0.], [ 0., &nbsp;0., &nbsp;0., &nbsp;0., &nbsp;0.,0., &nbsp;1.]])<\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u6700\u540e\u6765\u7edf\u8ba1\u4e00\u4e0b\u8282\u70b9\u7684\u8017\u6563\u6570\u636e\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"><span style=\"font-size: 14px;\"># return dissipationToSink,totalFlow,flowFromSource fn.networkDissipate(gd)<br  \/><\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u8ba1\u7b97\u7f51\u7edc\u4e2d\u7ed9\u5b9a\u8282\u70b91\u7684\u51fa\u6d41\u548c\u5165\u6d41\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">fn.outflow(gd, 1) fn.inflow(gd, 1)<\/code><\/pre>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u8ba1\u7b97\u7f51\u7edc\u4e2d\u6d41\u7684\u5e73\u5747\u957f\u5ea6\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"><span style=\"font-size: 14px;\">fn.averageFlowLength(gd)<\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u8ba1\u7b97\u6d41\u7f51\u7edc\u7684\u5e73\u5747\u65f6\u95f4\u77e9\u9635\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">fn.getAverageTimeMatrix(gd)<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\"><br  \/><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><strong>\u6700\u540e\u6211\u4eec\u8fdb\u884c\u753b\u56fe\u64cd\u4f5c\uff1a<\/strong><\/span><\/p>\n<p><span style=\"font-size: 14px;\"><strong><br  \/><\/strong><\/span><\/p>\n<p><span style=\"font-size: 14px;\">\u9996\u5148\u5c06\u6d41\u7f51\u7edc\u8f6c\u4e3a\u6811\u56fe\uff0c\u7136\u540e\u505a\u51fa y&nbsp;=&nbsp;(x+x*[0,1))**3\u7684\u51fd\u6570\u56fe\u50cf(\u53cc\u5bf9\u6570\u5750\u6807\u7cfb&lt;log,&nbsp;log&gt;\u4e0b,\u8fd1\u4f3c\u76f4\u7ebf) \uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">fig=plt.figure(figsize=(9.9)\uff0cfacecolor=\"white\" ax=fig.add_subplot(111) fn.plotTree(gd,ax) plt.show()  from random import random x=np.array(range(1,100)) y=(x+random()*x)**3  plt.plot(x,y) plt.xscale('log') plt.yscale(\"log\") plt.show()<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u8fd9\u6837\u6211\u4eec\u5c31\u753b\u51fa\u4e86\u7b2c\u4e00\u5f20\u56fe\uff1a<\/span><\/p>\n<div class=\"post-image\"><img    class=\"\"   src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma0-1534232017-1.png\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/div>\n<p><span style=\"font-size: 14px;\">\u7136\u540e\u6211\u4eec\u5bf9:&nbsp;y&nbsp;=&nbsp;(x+x*[0,1))**3\u7684\u51fd\u6570\u56fe\u50cf\u505a\u6700\u5c0f\u4e8c\u4e58\u6cd5\u7ebf\u6027\u62df\u5408(\u53cc\u5bf9\u6570\u6761\u4ef6\u4e0b,\u8fd1\u4f3c\u76f4\u7ebf) \uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">fn.alloRegressPlot(x,y,\"r\",\"s\",\"$x$\",\"$y$\",loglog=True)<br  \/><\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<div class=\"post-image\"><img    class=\"\"   src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma8-1534232017.png\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/div>\n<p><span style=\"font-size: 14px;\">\u753b\u6307\u6570\u622a\u65ad\u7684\u5e42\u5f8b\u5206\u5e03\u56fe\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \"><span style=\"font-size: 14px;\">rg = np.array([ 20.7863444 , &nbsp; 9.40547933, &nbsp; 8.70934714, &nbsp; 8.62690145,  7.16978087, &nbsp; 7.02575052, &nbsp; 6.45280959, &nbsp; 6.44755478,  5.16630287, &nbsp; 5.16092884, &nbsp; 5.15618737, &nbsp; 5.05610068,  4.87023561, &nbsp; 4.66753197, &nbsp; 4.41807645, &nbsp; 4.2635671 ,  3.54454372, &nbsp; 2.7087178 , &nbsp; 2.39016885, &nbsp; 1.9483156 ,  1.78393238, &nbsp; 1.75432688, &nbsp; 1.12789787, &nbsp; 1.02098332,  0.92653501, &nbsp; 0.32586582, &nbsp; 0.1514813 , &nbsp; 0.09722761]) fn.powerLawExponentialCutOffPlot(rg, '$x$', '$p(x)$')<\/span><\/code><\/pre>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u5f97\u5230\u5982\u56fe\u6240\u793a\uff1a<\/span><\/p>\n<div class=\"post-image\"><img loading=\"lazy\"    class=\"\"   width=\"413\" height=\"286\" style=\"width: 413px; height: 286px;\" src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma4-1534232017.png\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/div>\n<p><span style=\"font-size: 14px;\">\u753b\u51faDGBD\u56fe\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">fn.DGBDPlot(rg)  fn.DGBDPlot(rg)<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<div class=\"post-image\"><img    class=\"\"   src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma2-1534232018.png\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/div>\n<p><span style=\"font-size: 14px;\">\u753b\u5e42\u5f8b\u5206\u5e03\u56fe\u53ca\u62df\u5408\u66f2\u7ebf\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">from networkx.utils import powerlaw_sequence pl_sequence = powerlaw_sequence(1000,exponent=2.5)  fig = plt.figure(figsize=(4, 4),facecolor='white') ax = fig.add_subplot(111) fn.plotPowerlaw(pl_sequence,ax,'r','$x$')<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<div class=\"post-image\"><img    class=\"\"   src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma9-1534232018.png\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/div>\n<p><span style=\"font-size: 14px;\">\u753b\u51faCCDF\u56fe\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">fig = plt.figure(figsize=(4, 4),facecolor='white') ax = fig.add_subplot(111) fn.plotCCDF(pl_sequence,ax,'b','$x$')<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<div class=\"post-image\"><img    class=\"\"   src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma10-1534232018.png\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/div>\n<p><span style=\"font-size: 14px;\">\u753b\u51fa\u57fa\u5c3c\u7cfb\u6570\u56fe\uff1a<\/span><\/p>\n<section class=\"mpa-template\"   >\n<section  class=\"\"  style=\"margin: 0px; padding: 0px; color: rgb(62, 62, 62); font-size: 16px; line-height: 25.6px; white-space: normal; widows: 1; background-color: rgb(255, 255, 255);\">\n<section style=\"margin: 0px; padding: 0px;\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 10px 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 10px; display: inline-block; width: 670px; border-width: 1px; border-style: solid; border-color: rgb(192, 200, 209); background-color: rgb(239, 239, 239);\">\n<section class=\"\"  style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section class=\"\" style=\"margin: 0px; padding: 0px;\">\n<section style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 14px;\"><\/p>\n<pre style=\"margin-top: 0px !important; margin-right: 0px; margin-bottom: 0px !important; margin-left: 0px; padding-top: 6px; padding-right: 10px; padding-bottom: 6px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-style: initial; border-color: initial; font-size: 13px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; background-color: rgb(248, 248, 248); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); line-height: 19px; overflow-x: auto; overflow-y: auto; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; \"><code style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-style: initial; border-color: initial; font-size: 12px; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; white-space: pre; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: transparent; border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-left-radius: 3px 3px; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; \">bins, result, gini_val = fn.gini_coefficient(np.array(pl_sequence))  plt.plot(bins, bins, '--', label=\"perfect\") plt.plot(bins, result, label=\"observed\") plt.title(\"$GINI: %.4f$\" %(gini_val))  plt.legend(loc = 0, frameon = False) plt.show()<\/code><\/pre>\n<p><\/span><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<div class=\"post-image\"><img    class=\"\"   src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma10-1534232018-1.png\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/div>\n<p style=\"margin-right: 0.5em; margin-left: 0.5em; white-space: normal; text-align: center;\"><br  \/><span style=\"color: rgb(123, 12, 0); font-size: 16px;\"><strong>\u53c2\u8003\u8d44\u6599<\/strong><\/span><\/p>\n<p style=\"margin-right: 0.5em; margin-left: 0.5em; white-space: normal; text-align: center;\"><br  \/><\/p>\n<ol class=\"list-paddingleft-2\" style=\"list-style-type: decimal;\">\n<li>\n<p style=\"white-space: normal; margin-top: 10px;\"><span style=\"font-size: 14px;\">http:\/\/wiki.swarma.net\/index.php\/Python \u96c6\u667awiki\u4e0a\u9762\u7f16\u5199\u7684\u5173\u4e8e\u6d41\u7f51\u7edc\u7684\u7b97\u6cd5<\/span><\/p>\n<\/li>\n<li>\n<p style=\"white-space: normal; margin-top: 10px;\"><span style=\"font-size: 14px;\">http:\/\/wiki.swarma.net\/index.php\/%E5%9F%BA%E4%BA%8E%E9%A9%AC%E5%B0%94%E7%A7%91%E5%A4%AB%E9%93%BE%E7%9A%84%E6%B5%81%E7%BD%91%E7%BB%9C%E5%88%86%E6%9E%90 \u96c6\u667awiki\u4e0a\u7f16\u5199\u7684\u5173\u4e8e\u57fa\u4e8e\u9a6c\u5c14\u79d1\u592b\u94fe\u7684\u6d41\u7f51\u7edc\u5206\u6790<\/span><\/p>\n<\/li>\n<\/ol>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<div class=\"post-image\"><img    class=\"\"   src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma2-1534232018.jpeg\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/div>\n<p style=\"margin-top: 5px; white-space: normal; text-align: center; line-height: 1.75em;\"><span style=\"color: rgb(123, 12, 0); font-size: 14px;\"><strong><br  \/><\/strong><\/span><\/p>\n<p style=\"margin-top: 5px; white-space: normal; text-align: center; line-height: 1.75em;\"><span style=\"color: rgb(123, 12, 0); font-size: 14px;\"><strong><span style=\"color: rgb(236, 137, 33); font-size: 14px;\">\u6253\u5305\u7ec4\u8bfe\u53ea\u9700499\uffe5<\/span><\/strong><\/span><\/p>\n<p style=\"margin-top: 5px; white-space: normal; text-align: center; line-height: 1.75em;\"><span style=\"color: rgb(123, 12, 0); font-size: 14px;\"><strong><span style=\"color: rgb(236, 137, 33); font-size: 14px;\">\u53ef\u5f00\u53d1\u7968<\/span><\/strong><\/span><\/p>\n<p style=\"margin-top: 5px; white-space: normal; text-align: center; line-height: 1.75em;\"><span style=\"color: rgb(123, 12, 0); font-size: 14px;\"><strong><span style=\"color: rgb(236, 137, 33); font-size: 14px;\">\u56e2\u8d2d\u4eab\u4f18\u60e0<\/span><\/strong><\/span><\/p>\n<hr style=\"white-space: normal;\"  \/>\n<p style=\"margin-right: 0.5em; margin-left: 0.5em; font-size: 16px; white-space: normal; color: rgb(62, 62, 62); background-color: rgb(255, 255, 255); text-align: center;\"><img class=\"__bg_gif\"     width=\"100%\" style=\"letter-spacing: 0.5px; visibility: visible !important; width: 64px !important;\" src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma6-1534232018.gif\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><br  \/><\/p>\n<section   style=\"margin-right: 0.5em; margin-left: 0.5em; font-size: 16px; white-space: normal; color: rgb(62, 62, 62); line-height: 25.6px; letter-spacing: 0.5px; background-color: rgb(255, 255, 255);\">\n<section   style=\"margin-right: 0.5em; margin-left: 0.5em; line-height: 25.6px; text-align: center; outline: none;\">\n<section   style=\"margin-right: 0.5em; margin-left: 0.5em; line-height: 25.6px; outline: none;\">\n<section   style=\"outline: none;\">\n<section  style=\"margin-right: 0.5em; margin-left: 0.5em; font-size: 15px; outline: none;\">\n<section  style=\"line-height: 25.6px; border-color: rgb(123, 12, 0);\">\n<p style=\"margin-top: 10px; margin-bottom: 10px; padding-right: 3px; padding-left: 3px; transform: translate3d(0px, 0px, 0px); border-color: rgb(123, 12, 0); line-height: 1.5em;\"><span style=\"font-size: 14px;\"><strong><span style=\"font-size: 12px; color: rgb(136, 136, 136);\">\u96c6\u667aQQ\u7fa4\uff5c292641157<br  \/>\u5546\u52a1\u5408\u4f5c\uff5czhangqian@swarma.org<br  \/>\u6295\u7a3f\u8f6c\u8f7d\uff5cwangting@swarma.org<\/span><\/strong><\/span><\/p>\n<section   style=\"margin-right: 0.5em; margin-left: 0.5em; outline: none;\">\n<h1 style=\"margin-top: 10px; margin-bottom: 10px; line-height: 1.75em;\"><span style=\"font-size: 14px;\"><strong style=\"font-size: 14px; white-space: pre-wrap; color: rgb(0, 112, 192); line-height: 25.6px;\"><strong style=\"line-height: 28px; white-space: normal; color: rgb(61, 170, 214); font-size: 20px;\"><span style=\"font-size: 14px; color: rgb(136, 136, 136);\"><span style=\"font-size: 14px; color: rgb(255, 76, 0);\">\u25c6&nbsp;<\/span><span style=\"font-size: 14px; color: rgb(0, 128, 255);\">\u25c6&nbsp;<\/span><span style=\"font-size: 14px; color: rgb(61, 170, 214);\">\u25c6<\/span><\/span><\/strong><\/strong><\/span><\/h1>\n<\/section>\n<p style=\"margin-right: 0.5em; margin-left: 0.5em; font-size: 19px; font-family: \u5fae\u8f6f\u96c5\u9ed1; color: rgb(71, 193, 168); line-height: 23.2727px; overflow-wrap: break-word !important;\"><span style=\"color: rgb(123, 12, 0); font-size: 14px;\"><strong>\u641c\u7d22\u516c\u4f17\u53f7\uff1a\u96c6\u667a\u4ff1\u4e50\u90e8<\/strong><\/span><\/p>\n<p style=\"margin-right: 0.5em; margin-left: 0.5em; font-size: 19px; font-family: \u5fae\u8f6f\u96c5\u9ed1; color: rgb(71, 193, 168); line-height: 23.2727px; overflow-wrap: break-word !important;\"><span style=\"color: rgb(0, 0, 0); font-size: 14px;\"><strong><br  \/><\/strong><\/span><\/p>\n<p style=\"margin-right: 0.5em; margin-left: 0.5em; font-size: 19px; font-family: \u5fae\u8f6f\u96c5\u9ed1; color: rgb(71, 193, 168); line-height: 23.2727px; overflow-wrap: break-word !important;\"><span style=\"color: rgb(0, 0, 0); font-size: 14px;\"><strong>\u52a0\u5165\u201c\u6ca1\u6709\u56f4\u5899\u7684\u7814\u7a76\u6240\u201d<\/strong><\/span><\/p>\n<section style=\"margin-right: 0.5em; margin-left: 0.5em; font-size: 14px; color: rgb(71, 193, 168); line-height: 20px; overflow-wrap: break-word !important;\">\n<p style=\"margin: 5px auto; padding: 10px; width: 180px; border-width: 2px; border-style: dashed; border-color: rgb(132, 132, 132); line-height: normal; overflow-wrap: break-word !important;\"><img class=\"\"      width=\"auto\" style=\"overflow-wrap: break-word !important; visibility: visible !important; width: auto !important;\" src=\"http:\/\/swarma.org\/wp-content\/uploads\/2018\/08\/swarma6-1534232019.jpeg\" alt=\"\u96c6\u667a\" title=\"\u96c6\u667a\"  \/><\/p>\n<\/section>\n<p><span style=\"font-size: 14px;\">\u8ba9\u82f9\u679c\u7838\u5f97\u66f4\u731b\u70c8\u4e9b\u5427\uff01<\/span><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<blockquote class='keep-source'>\n<p>\u59cb\u53d1\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a                         \u96c6\u667a\u4ff1\u4e50\u90e8                      <\/p>\n<\/blockquote>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5f00\u653e\u7684\u6d41\u7f51\u7edc\uff08Open Flow Network\uff09\uff0c\u6216\u6d41\u52a8\u7f51\u7edc\uff0c\u4e5f\u7b80\u79f0\u6d41\u7f51\u7edc(Flow Network)\u662f\u6307\u4e00\u7c7b\u7279\u6b8a\u7684\u52a0\u6743\u6709\u5411\u7684\u590d\u6742\u7f51\u7edc\u3002\u5176\u4e2d\uff0c\u6709\u5411\u8fde\u8fb9\u8868\u793a\u80fd\u91cf\u3001\u7269\u8d28\u3001\u8d27\u5e01\u3001\u4fe1\u606f\u3001\u6ce8\u610f\u529b\u7b49\u6d41\u52a8\u7684\u65b9\u5411\uff0c\u8fde\u8fb9\u7684\u6743\u91cd\u5219\u8868\u793a\u6d41\u91cf\u3002\u5f00\u653e\u6027\u4f53\u73b0\u4e3a\u7f51\u7edc\u4e2d\u5b58\u5728\u7740\u6e90\u548c\u6c47\u4e24\u7c7b\u7279\u6b8a\u7684\u8282\u70b9\u4ee3\u8868\u73af\u5883\u3002\u76ee\u524d\uff0c\u5f00\u653e\u6d41\u7f51\u7edc\u8fd9\u79cd\u6a21\u578b&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4313,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[],"special":[],"_links":{"self":[{"href":"https:\/\/swarma.org\/index.php?rest_route=\/wp\/v2\/posts\/4312"}],"collection":[{"href":"https:\/\/swarma.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swarma.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swarma.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swarma.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4312"}],"version-history":[{"count":1,"href":"https:\/\/swarma.org\/index.php?rest_route=\/wp\/v2\/posts\/4312\/revisions"}],"predecessor-version":[{"id":4331,"href":"https:\/\/swarma.org\/index.php?rest_route=\/wp\/v2\/posts\/4312\/revisions\/4331"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/swarma.org\/index.php?rest_route=\/wp\/v2\/media\/4313"}],"wp:attachment":[{"href":"https:\/\/swarma.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swarma.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swarma.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4312"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/swarma.org\/index.php?rest_route=%2Fwp%2Fv2%2Fspecial&post=4312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}