<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://www.33dai.wiki/index.php?action=history&amp;feed=atom&amp;title=11-%E5%9B%BE%E8%AE%BA%2F01-%E5%9B%BE%E8%AE%BA%E5%9F%BA%E7%A1%80</id>
	<title>11-图论/01-图论基础 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://www.33dai.wiki/index.php?action=history&amp;feed=atom&amp;title=11-%E5%9B%BE%E8%AE%BA%2F01-%E5%9B%BE%E8%AE%BA%E5%9F%BA%E7%A1%80"/>
	<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=11-%E5%9B%BE%E8%AE%BA/01-%E5%9B%BE%E8%AE%BA%E5%9F%BA%E7%A1%80&amp;action=history"/>
	<updated>2026-05-20T23:47:59Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=11-%E5%9B%BE%E8%AE%BA/01-%E5%9B%BE%E8%AE%BA%E5%9F%BA%E7%A1%80&amp;diff=439&amp;oldid=prev</id>
		<title>33DAI：​批量导入三三文档</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=11-%E5%9B%BE%E8%AE%BA/01-%E5%9B%BE%E8%AE%BA%E5%9F%BA%E7%A1%80&amp;diff=439&amp;oldid=prev"/>
		<updated>2026-05-20T18:24:05Z</updated>

		<summary type="html">&lt;p&gt;批量导入三三文档&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月20日 (三) 18:24的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l100&quot;&gt;第100行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第100行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:图论]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:图论]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:三三文档]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:三三文档]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki:diff:1.41:old-409:rev-439:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=11-%E5%9B%BE%E8%AE%BA/01-%E5%9B%BE%E8%AE%BA%E5%9F%BA%E7%A1%80&amp;diff=409&amp;oldid=prev</id>
		<title>33DAI：​导入1个版本</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=11-%E5%9B%BE%E8%AE%BA/01-%E5%9B%BE%E8%AE%BA%E5%9F%BA%E7%A1%80&amp;diff=409&amp;oldid=prev"/>
		<updated>2026-05-20T18:12:22Z</updated>

		<summary type="html">&lt;p&gt;导入1个版本&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年5月20日 (三) 18:12的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=11-%E5%9B%BE%E8%AE%BA/01-%E5%9B%BE%E8%AE%BA%E5%9F%BA%E7%A1%80&amp;diff=408&amp;oldid=prev</id>
		<title>-&gt;Importer：​批量导入三三文档</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=11-%E5%9B%BE%E8%AE%BA/01-%E5%9B%BE%E8%AE%BA%E5%9F%BA%E7%A1%80&amp;diff=408&amp;oldid=prev"/>
		<updated>2026-05-20T16:50:33Z</updated>

		<summary type="html">&lt;p&gt;批量导入三三文档&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== 图论基础 ==&lt;br /&gt;
&lt;br /&gt;
图（Graph）由 &amp;#039;&amp;#039;&amp;#039;顶点（Vertex）&amp;#039;&amp;#039;&amp;#039; 和 &amp;#039;&amp;#039;&amp;#039;边（Edge）&amp;#039;&amp;#039;&amp;#039; 组成。&lt;br /&gt;
&lt;br /&gt;
=== 基本概念 ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! 概念 !! 说明&lt;br /&gt;
|-&lt;br /&gt;
| 顶点&lt;br /&gt;
| 图中的节点，通常编号为 &amp;lt;math&amp;gt;1 \sim n&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 边&lt;br /&gt;
| 连接两个顶点的连线，可能带有方向或权值&lt;br /&gt;
|-&lt;br /&gt;
| 有向图&lt;br /&gt;
| 边有方向，&amp;lt;math&amp;gt;u \to v&amp;lt;/math&amp;gt; 不同于 &amp;lt;math&amp;gt;v \to u&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 无向图&lt;br /&gt;
| 边无方向，&amp;lt;math&amp;gt;(u, v)&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;(v, u)&amp;lt;/math&amp;gt; 是同一条边&lt;br /&gt;
|-&lt;br /&gt;
| 度&lt;br /&gt;
| 顶点的度 = 与该点相连的边数。有向图分为入度和出度&lt;br /&gt;
|-&lt;br /&gt;
| 环（自环）&lt;br /&gt;
| 起点 = 终点的边&lt;br /&gt;
|-&lt;br /&gt;
| 重边&lt;br /&gt;
| 两点之间存在多条边&lt;br /&gt;
|-&lt;br /&gt;
| 简单图&lt;br /&gt;
| 无自环、无重边的图&lt;br /&gt;
|-&lt;br /&gt;
| 稀疏图 / 稠密图&lt;br /&gt;
| &amp;lt;math&amp;gt;m \approx n&amp;lt;/math&amp;gt; 为稀疏，&amp;lt;math&amp;gt;m \approx n^2&amp;lt;/math&amp;gt; 为稠密&lt;br /&gt;
|-&lt;br /&gt;
| 路径&lt;br /&gt;
| 首尾相连的边的序列&lt;br /&gt;
|-&lt;br /&gt;
| 简单路径&lt;br /&gt;
| 路径中每个顶点只出现一次&lt;br /&gt;
|-&lt;br /&gt;
| 连通图&lt;br /&gt;
| 任意两点之间存在路径&lt;br /&gt;
|-&lt;br /&gt;
| 树&lt;br /&gt;
| 无环连通图，&amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点 &amp;lt;math&amp;gt;n-1&amp;lt;/math&amp;gt; 条边&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 邻接矩阵 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;g[u][v]&amp;lt;/math&amp;gt; 表示 &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt; 到 &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; 的边权（无边则为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\infty&amp;lt;/math&amp;gt;）。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int g[1005][1005]; // 空间 O(n^2)，适合 n &amp;lt;= 5000 的稠密图&lt;br /&gt;
&lt;br /&gt;
void add_edge(int u, int v, int w)&lt;br /&gt;
{&lt;br /&gt;
    g[u][v] = w;&lt;br /&gt;
    // 无向图：g[v][u] = w;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 邻接表（vector） ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
struct Edge&lt;br /&gt;
{&lt;br /&gt;
    int to, w;&lt;br /&gt;
};&lt;br /&gt;
vector&amp;lt;Edge&amp;gt; g[MAXN]; // 空间 O(m)&lt;br /&gt;
&lt;br /&gt;
void add_edge(int u, int v, int w)&lt;br /&gt;
{&lt;br /&gt;
    g[u].push_back({v, w});&lt;br /&gt;
    // 无向图：g[v].push_back({u, w});&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 链式前向星 ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
int head[MAXN], to[MAXM * 2], w[MAXM * 2], nxt[MAXM * 2], cnt;&lt;br /&gt;
&lt;br /&gt;
void add_edge(int u, int v, int weight)&lt;br /&gt;
{&lt;br /&gt;
    cnt++;&lt;br /&gt;
    to[cnt] = v;&lt;br /&gt;
    w[cnt] = weight;&lt;br /&gt;
    nxt[cnt] = head[u];&lt;br /&gt;
    head[u] = cnt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// 遍历 u 的所有邻居&lt;br /&gt;
for (int i = head[u]; i; i = nxt[i])&lt;br /&gt;
    int v = to[i], weight = w[i];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:图论]]&lt;br /&gt;
[[Category:三三文档]]&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>-&gt;Importer</name></author>
	</entry>
</feed>