0

I have a fuzzy graph G=(V, E) where V is the set of vertices and E is the set of edges. Every vertex is a fuzzy vertex, that means, it has a property with a membership function associated to it (stored in the vertex somehow). Every edge is a fuzzy edge, that means, it has a property with a membership function associated to it (stored in the edge somehow). By doing this, G is a fuzzy graph in terms of edges and vertices.

Given G and G2, another fuzzy graph with different (or equal) number of edges and/or vertices, I need to compare both graphs in a fuzzy way. I want to check if G2 is a subgraph or G (or vice versa). Is there any algorithm to address this?

Néstor
  • 351
  • 1
  • 5
  • 20
  • I think I don't get you... @Yonlif – Néstor Jun 11 '19 at 18:38
  • The function is stored in the vertex/edge somehow. So, when comparing two nodes/edges, you can call it to check the value of the node/edge for comparing it. @Yonlif – Néstor Jun 11 '19 at 18:43
  • Oh I get it now! Do you need to address the function computation time? – Yonlif Jun 11 '19 at 18:45
  • Well, the algorithm should be as fast as possible, but this is not the main goal. Regarding the membership function, it should be `O(1)`, so don't worry about it. @Yonlif – Néstor Jun 11 '19 at 18:50
  • So each vertex has a function which can be passed another vertex and returns a boolean indicating whether the second vertex is a member of the first? – Richard Jun 14 '19 at 23:05
  • What is a "membership function?" What is the signature of these functions and what do they compute? Subgraph isomorphism is trivially O(n) if vertices and edges are labeled. – Gene Jun 15 '19 at 00:13
  • @Richard each vertex and each edge has a membership function (https://en.wikipedia.org/wiki/Membership_function_(mathematics)) associated to the fuzzy set that it represents. This function will return a value (normally between 0 and 1) that will be used to compare nodes/edges. Two nodes will be similar if they have a similar value for their membership functions. The comparison should be fuzzy. – Néstor Jun 15 '19 at 08:36
  • @Gene take a look at my previous comment please. – Néstor Jun 15 '19 at 08:36
  • @Néstor What do you mean by «comparing in a fuzzy way»? As far as I understand you need to know if there is a perfect match between G and G2. What if e.g. the match is 1-near perfect? or 2-near, etc.? – hidefromkgb Jun 15 '19 at 10:10
  • @hidefromkgb You can have concrete/crisp information or fuzzy information. I need to compare both graphs in a fuzzy way: https://en.wikipedia.org/wiki/Fuzzy_logic In fact, I don't need a perfect match, I need to know how similar are both graphs or how much is one graph a subgraph of the other one. – Néstor Jun 15 '19 at 11:31
  • @Néstor I understand what fuzzy logic is. What I don\`t is the term «comparing in a fuzzy way». How similar «in a fuzzy way» are e.g. a triangle-shaped graph and a square-shaped graph? – hidefromkgb Jun 15 '19 at 12:00
  • @hidefromkgb The fuzziness is in the nodes and edges, not in the graph. Imagine two trivial graphs, G1 and G2 with one node each one. Both nodes represent a fuzzy color. The node in G1 has a membership degree to the red color of 0.7. The node in G2 has a membership degree to the red color of 0.7. G2 is a subgraph of G1 with a 1.0 of matching. Same situation but now the node in G2 has a membership degree to the red color of 0.5. G2 is a subgraph of G1 with a X degree of matching where 0.0 < X < 1.0. – Néstor Jun 15 '19 at 12:10
  • @Néstor So what is the similarity metric by which X gets computed? Is it e.g. exp(–abs(e₁ – e₂)) or, say, 2cot⁻¹(abs(e₁ – e₂))/π, or even a Dirac delta? And then, how does that metric scale beyond a single graph node? These two things are crucial to devise an algorithm, for without them we won\`t be able to answer whether it`s better to e.g. cover all nodes but get a <1.0 metric on any of them, or to cover less nodes but maintain a strict 1.0, all that stuff. – hidefromkgb Jun 15 '19 at 12:52
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/194995/discussion-between-nestor-and-hidefromkgb). – Néstor Jun 15 '19 at 15:22
  • I have created a chat based on stackoverflow's suggestion, take a look at my previous comment @hidefromkgb – Néstor Jun 16 '19 at 07:43

2 Answers2

2

First, to compare two graphs you should solve the Subgraph isomorphism problem, it could be polynomial or not.

But you have not graphs, you have fuzzy graphs. I don't know if explicit algorithm exists but I would try two approaches:

  1. If you can define membership as a probability, you can first find "the maximum similarity" assuming usual graphs (P{is member}=1) and then, try to find some relation using Bayesian networks (if acyclic) or in a more general way using Markov random fields.

  2. You can define a metric between fuzzy graphs using Monte Carlo methods. As an example simply walk the two graphs and stop when one step produce some difference. The number of steps is a metric. Run n times and get the max, avg, ... The final algorithm depends strongly if your membership function have state, you know "the maximum similarity" and so...

The former approach should be fast and reliable but you have nothing if you can't find the adequate equations. The latter approach, looks more feasible but much less efficient.

Anyway, the usability of the defined metric is subjetive (if you don't explain the requirements, any metric could be valid).

josejuan
  • 9,338
  • 24
  • 31