isomorphism

algorithm to check whether a given graph is subgraph of another graph [closed]

こ雲淡風輕ζ 提交于 2019-12-06 07:32:47
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center . Closed 8 years ago . i assume that we have 2 labeled graphs G and T and the algorithm determine if G a subgraph of T and the corresponding vertices in the main graphT and the subgraph G should have same label That problem is called "subgraph isomorphism" and it is NP-complete (and so likely to be hard). Do you need a general solution

Isomorphisms between 3 and more types using lens

自闭症网瘾萝莉.ら 提交于 2019-12-05 01:28:26
Inspired by a question on polymorphic function between ADTs I'm trying to create isomorphisms between multiple (not just 2) types, so that every time I need an isomorphic but not the same type, I can sprinkle my code with some convert . Suppose I have 3 ADTs: data AB = A | B deriving (Show) data CD = C | D deriving (Show) data EF = E | F deriving (Show) Using lens I can implement 2 isomorphisms between AB and CD, and CD and EF: {-# LANGUAGE MultiParamTypeClasses #-} class Isomorphic a b where convert :: Iso' a b instance Isomorphic AB CD where convert = iso ab2cd cd2ab where ab2cd A = C ab2cd

What's the Difference Between Subgraph Isomorphism and Subgraph Monomorphism?

Deadly 提交于 2019-12-03 13:57:16
In one of the projects I've worked on, the subject of isomorphism versus monomorphism came up . A little background: I'm no expert on graph theory and have no formal training in it. But this topic is very important in chemistry, where chemists expect a particular kind of subgraph matching to take place in the structure search systems they use. If a target graph A has n nodes and m edges, then a chemist would accept subgraph matches in which a query graph B had n nodes and m-1 edges. The only requirement would be that every edge in B should be present in A. For example, a linear chain of 6

Rejecting isomorphisms from collection of graphs

谁说胖子不能爱 提交于 2019-11-30 06:48:53
I have a collection of 15M (Million) DAGs (directed acyclic graphs - directed hypercubes actually) that I would like to remove isomorphisms from. What is the common algorithm for this? Each graph is fairly small, a hybercube of dimension N where N is 3 to 6 (for now) resulting in graphs of 64 nodes each for N=6 case. Using networkx and python, I implemented it like this which works for small sets like 300k (Thousand) just fine (runs in a few days time). def isIsomorphicDuplicate(hcL, hc): """checks if hc is an isomorphism of any of the hc's in hcL Returns True if hcL contains an isomorphism of

What does it mean for two binary trees to be isomorphic?

拜拜、爱过 提交于 2019-11-30 03:16:35
What does it mean for two binary trees to be isomorphic? I've been looking online and I can't seem to find a clear explanation. As far as I understand, two trees are isomorphic if they have the same shape. So I'm guessing two identical trees which can contain different values in the nodes. Isomorphic comes from the Greek "same shape" (like isobar is points with the same air pressure and polygon means "many sided") so your understanding is correct. But don't make the mistake of assuming shape in this case is a physical shape (like the tree has one root, one left node and one right node; see

Rejecting isomorphisms from collection of graphs

ぃ、小莉子 提交于 2019-11-29 06:27:57
问题 I have a collection of 15M (Million) DAGs (directed acyclic graphs - directed hypercubes actually) that I would like to remove isomorphisms from. What is the common algorithm for this? Each graph is fairly small, a hybercube of dimension N where N is 3 to 6 (for now) resulting in graphs of 64 nodes each for N=6 case. Using networkx and python, I implemented it like this which works for small sets like 300k (Thousand) just fine (runs in a few days time). def isIsomorphicDuplicate(hcL, hc): ""

What does it mean for two binary trees to be isomorphic?

允我心安 提交于 2019-11-29 00:56:25
问题 What does it mean for two binary trees to be isomorphic? I've been looking online and I can't seem to find a clear explanation. As far as I understand, two trees are isomorphic if they have the same shape. So I'm guessing two identical trees which can contain different values in the nodes. 回答1: Isomorphic comes from the Greek "same shape" (like isobar is points with the same air pressure and polygon means "many sided") so your understanding is correct. But don't make the mistake of assuming