<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Graphviz | 背景</title>
	<atom:link href="https://moonpeta.com/tag/graphviz/feed/" rel="self" type="application/rss+xml" />
	<link>https://moonpeta.com</link>
	<description></description>
	<lastBuildDate>Thu, 24 Feb 2022 03:55:00 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://moonpeta.com/wp-content/uploads/2023/10/cropped-wraith_logo_ribon_pink-32x32.png</url>
	<title>Graphviz | 背景</title>
	<link>https://moonpeta.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Graphvizで木をplotするときのrootの決め方</title>
		<link>https://moonpeta.com/tips/graphviztips1/</link>
					<comments>https://moonpeta.com/tips/graphviztips1/#respond</comments>
		
		<dc:creator><![CDATA[フローラ]]></dc:creator>
		<pubDate>Wed, 23 Feb 2022 10:49:27 +0000</pubDate>
				<category><![CDATA[python]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Graphviz]]></category>
		<category><![CDATA[tree]]></category>
		<guid isPermaLink="false">https://www.fruity-floral.com/?p=1528</guid>

					<description><![CDATA[　edgeを作るときにedge(root,other)という順番で入れる必要がある。 　root以外のnodeについても、rootからみて上にある方がuで下にある方がdならG.edge(u,d)という順番でいれるとうまく [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>　edgeを作るときにedge(root,other)という順番で入れる必要がある。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-python" data-lang="Python"><code>#0がroot
G=graphviz.Graph(format=&#39;png&#39;)
G.edge(&#39;0&#39;,&#39;1&#39;)
G.edge(&#39;0&#39;,&#39;2&#39;)
G.edge(&#39;1&#39;,&#39;3&#39;)
G.edge(&#39;1&#39;,&#39;4&#39;)
G.view()</code></pre></div>



<figure class="wp-block-image size-full"><a href="https://moonpeta.com/wp-content/uploads/2022/02/Graph1.png"><img fetchpriority="high" decoding="async" width="227" height="251" src="https://moonpeta.com/wp-content/uploads/2022/02/Graph1.png" alt="" class="wp-image-1531"/></a></figure>



<div class="hcb_wrap"><pre class="prism line-numbers lang-python" data-lang="Python"><code>#同じ木で1がroot
G=graphviz.Graph(format=&#39;png&#39;)
G.edge(&#39;1&#39;,&#39;0&#39;)
G.edge(&#39;0&#39;,&#39;2&#39;)
G.edge(&#39;1&#39;,&#39;3&#39;)
G.edge(&#39;1&#39;,&#39;4&#39;)
G.view()</code></pre></div>



<figure class="wp-block-image size-full"><a href="https://moonpeta.com/wp-content/uploads/2022/02/Graph2.png"><img decoding="async" width="275" height="251" src="https://moonpeta.com/wp-content/uploads/2022/02/Graph2.png" alt="" class="wp-image-1530"/></a></figure>



<p>　root以外のnodeについても、rootからみて上にある方がuで下にある方がdならG.edge(u,d)という順番でいれるとうまくplotされる。rootから深さ優先探索（もしくは幅優先探索）しながらplotしていくときれいになる。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://moonpeta.com/tips/graphviztips1/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
