【发布时间】:2010-09-20 05:42:07
【问题描述】:
答案更新,12/22: 使用 Peter Shor 的observation,即立方体上不同部分和对象排列之间存在同态,通过将一组立方体对称表示为 SymmetricGroup[8] 的子组并使用 GroupElements/Permute 列出所有此类排列,使用以下方法查找质心分配Mathematica 的 SAT 求解器,选择具有不同奇异值的点集,提供更多细节和完整代码 here
问题
一个有趣的 2D 截面是一个平面,它穿过常规 3D simplex 的中心和其他 2 个点,每个点都是一些非空顶点子集的质心。它由两个顶点子集定义。例如 {{1},{1,2}} 给出了一个由 3 个点定义的平面——四面体的中心、第一个顶点以及第一个和第二个顶点的平均值。
一组有趣的部分是一组没有两个部分在顶点重新标记下定义相同的平面。例如,设置 {{{1},{2}},{{3},{4}}} 并不有趣。有没有一种有效的方法来找到一组有趣的有趣部分?我需要一些可以推广到 7D 单纯形的 3D 部分的类似问题的东西,并在一夜之间完成。
我尝试的方法如下。一个问题是,如果你忽略几何,一些等效部分将被保留,所以我得到 10 个部分而不是 3 个。更大的问题是我使用了蛮力,它绝对不能缩放并且(需要 10^17 7D 单纯形的比较)
(来源:yaroslavvb.com)
这是上面生成图片的Mathematica代码。
entropy[vec_] := Total[Table[p Log[p], {p, vec}]];
hadamard = KroneckerProduct @@ Table[{{1, 1}, {1, -1}}, {2}];
(* rows of hadamard matrix give simplex vertex coordinates *)
vertices = hadamard;
invHad = Inverse[hadamard];
m = {m1, m2, m3, m4};
vs = Range[4];
(* take a set of vertex averages, generate all combinations arising \
from labeling of vertices *)
vertexPermutations[set_] := (
newSets = set /. Thread[vs -> #] & /@ Permutations[vs];
Map[Sort, newSets, {2}]
);
(* anchors used to define a section plane *)
sectionAnchors = Subsets[{1, 2, 3, 4}, {1, 3}];
(* all sets of anchor combinations with centroid anchor always \
included *)
anchorSets = Subsets[sectionAnchors, {2}];
anchorSets = Prepend[#, {1, 2, 3, 4}] & /@ anchorSets;
anchorSets = Map[Sort, anchorSets, {2}];
setEquivalent[set1_, set2_] := MemberQ[vertexPermutations[set1], set2];
equivalenceMatrix =
Table[Boole[setEquivalent[set1, set2]], {set1, anchorSets}, {set2,
anchorSets}];
Needs["GraphUtilities`"];
(* Representatives of "vertex-relabeling" equivalence classes of \
ancher sets *)
reps = First /@ StrongComponents[equivalenceMatrix];
average[verts_] := Total[vertices[[#]] & /@ verts]/Length[verts];
makeSection2D[vars_, {p0_, p1_, p2_}] := Module[{},
v1 = p1 - p0 // Normalize;
v2 = p2 - p0;
v2 = v2 - (v1.v2) v1 // Normalize;
Thread[vars -> (p0 + v1 x + v2 y)]
];
plotSection2D[f_, pointset_] := (
simplex =
Graphics3D[{Yellow, Opacity[.2],
GraphicsComplex[Transpose@Rest@hadamard,
Polygon[Subsets[{1, 2, 3, 4}, {3}]]]}];
anchors = average /@ pointset;
section = makeSection2D[m, anchors];
rf = Function @@ ({{x, y, z, u, v},
And @@ Thread[invHad.{1, x, y, z} > 0]});
mf = Function @@ {{p1, p2, p3, x, y}, f[invHad.m /. section]};
sectionPlot =
ParametricPlot3D @@ {Rest[m] /. section, {x, -3, 3}, {y, -3, 3},
RegionFunction -> rf, MeshFunctions -> {mf}};
anchorPlot = Graphics3D[Sphere[Rest[#], .05] & /@ anchors];
Show[simplex, sectionPlot, anchorPlot]
);
plots = Table[
plotSection2D[entropy, anchorSets[[rep]]], {rep, reps}];
GraphicsGrid[Partition[plots, 3]]
【问题讨论】:
-
你能解释一下为什么 {{1,2},{3,4}} 不“有趣”吗?给出相同部分的重新标记是什么?
-
您将顶点 1 映射到 3 并将顶点 2 映射到 4。这并不有趣,因为部分看起来相同。在我的图片中,您可以看到只有两种不同的形状——三角形和正方形。其他一切都是这些形状的某种旋转/反射
-
我已经尝试了几次来弄清楚 {{1},{1,2}} 和 {{{1},{2}},{{3},{4} 的符号}},但就是不能。你能提供一个解释它的链接吗?
-
每个部分由一组质心定义。每个质心由一组顶点定义。因此,部分集合 {{{1},{2}},{{3},{4}}} 具有 3 个嵌套级别——部分、质心、顶点。顺便说一句,这个问题由 Peter Shor 回答了 7 维单纯形 mathoverflow.net/questions/39429/…
-
所以,如果我理解这个问题,您需要找到顶点的超集并获取其中每个集合的质心。然后创建与其中每两个相交的每个平面以及单纯形的质心……对吗?
标签: algorithm wolfram-mathematica geometry