BooleanGraph[bfunc,g1,…,gn]
グラフ g1, …, gnに対してブール関数 bfunc で定義されたブールグラフを与える.
BooleanGraph
BooleanGraph[bfunc,g1,…,gn]
グラフ g1, …, gnに対してブール関数 bfunc で定義されたブールグラフを与える.
詳細とオプション
- ブールグラフには頂点リストの和集合で与えられた頂点リストがある.
- bfunc[EdgeQ[g1,uv],…,EdgeQ[gn,uv]]がTrueであれば,結果のグラフには辺 uv がある.
- bfunc[EdgeQ[gi,uv],…,EdgeQ[gn,uv]]がTrueであれば,結果のグラフには辺 uv がある.
- GraphUnion[g1,g2]はBooleanGraph[Or,g1,g2]に等しい.
- GraphIntersection[g1,g2]はBooleanGraph[And,g1,g2]に等しい.
- GraphDifference[g1,g2]はBooleanGraph[#1∧¬#2&,g1,g2]に等しい.
- BooleanGraphは,無向グラフ,有向グラフ,多重グラフ,混合グラフに使うことができる.
例題
すべて開く すべて閉じる例 (1)
スコープ (5)
BooleanGraphは無向グラフに使うことができる:
BooleanGraph[And, [image], [image]]BooleanGraph[Or, [image], [image]]BooleanGraphはブール関数と同じ数のグラフに使うことができる:
BooleanGraph[Or, [image], [image], [image]]BooleanGraph[And, [image], [image]]BooleanGraph[Or, [image], [image]]アプリケーション (4)
対称グラフの差分Xorを定義する:
{g1 = RandomGraph[{20, 30}], g2 = RandomGraph[{20, 30}]}ブール式Xorを論理和標準形に変換する:
BooleanConvert[Xor[x, y]]GraphUnion[GraphIntersection[g1, GraphComplement[g2]], GraphIntersection[g2, GraphComplement[g1]]]Xorを直接使った結果と比較する:
IsomorphicGraphQ[%, SimpleGraph[BooleanGraph[Xor, g1, g2]]]グラフNandを定義する:
{g1 = RandomGraph[{20, 30}], g2 = RandomGraph[{20, 30}]}ブール式Nandを論理和標準形に変換する:
BooleanConvert[Nand[x, y]]GraphUnion[GraphComplement[g2], GraphComplement[g1]]Nandを直接使った結果と比較する:
IsomorphicGraphQ[%, SimpleGraph[BooleanGraph[Nand, g1, g2]]]グラフNorを定義する:
{g1 = RandomGraph[{20, 30}], g2 = RandomGraph[{20, 30}]}ブール式Norを論理和標準形に変換する:
BooleanConvert[Nor[x, y]]GraphIntersection[GraphComplement[g1], GraphComplement[g2]]Norを直接使った結果と比較する:
IsomorphicGraphQ[%, SimpleGraph[BooleanGraph[Nor, g1, g2]]]g1 = [image];g2 = [image];vc = AbsoluteOptions[g1, VertexCoordinates];BooleanFunctionを使って二変数のすべてのブール関数を列挙する:
Table[TraditionalForm@BooleanFunction[i, {x, y}], {i, 0, 2 ^ 2 ^ 2 - 1}]Table[Tooltip[BooleanGraph[BooleanFunction[i, 2], g1, g2, vc, PlotLabel -> i], TraditionalForm@BooleanFunction[i, {x, y}]], {i, 0, 15}]特性と関係 (3)
GraphUnionはOrに対応する:
{g1, g2} = {[image], [image]};IsomorphicGraphQ[BooleanGraph[Or, g1, g2], GraphUnion[g1, g2]]GraphIntersectionはAndに対応する:
{g1, g2} = {[image], [image]};IsomorphicGraphQ[BooleanGraph[And, g1, g2], GraphIntersection[g1, g2]]BooleanGraphは必ずしも単純グラフを生成するとは限らない:
BooleanGraph[Not, [image]]単純グラフのみが必要なときはSimpleGraphを使う:
SimpleGraph[%]関連するガイド
テキスト
Wolfram Research (2010), BooleanGraph, Wolfram言語関数, https://reference.wolfram.com/language/ref/BooleanGraph.html (2014年に更新).
CMS
Wolfram Language. 2010. "BooleanGraph." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/BooleanGraph.html.
APA
Wolfram Language. (2010). BooleanGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BooleanGraph.html
BibTeX
@misc{reference.wolfram_2026_booleangraph, author="Wolfram Research", title="{BooleanGraph}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/BooleanGraph.html}", note=[Accessed: 07-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_booleangraph, organization={Wolfram Research}, title={BooleanGraph}, year={2014}, url={https://reference.wolfram.com/language/ref/BooleanGraph.html}, note=[Accessed: 07-September-2026]}