Repository: networkx/networkx

Issue:
vf2pp_is_isomorphic returns wrong results
<!-- If you have a general question about NetworkX, please use the discussions tab to create a new discussion -->

<!--- Provide a general summary of the issue in the Title above -->

### Current Behavior
```
import networkx as nx
g = nx.MultiDiGraph({0: [1, 1, 2, 2, 3], 1: [2, 3, 3], 2: [3]})
h = nx.MultiDiGraph({0: [1, 1, 2, 2, 3], 1: [2, 3, 3], 3: [2]})
print(nx.is_isomorphic(g, h))
print(nx.vf2pp_is_isomorphic(g, h))
```
prints:
```
False
True
```
<!--- Tell us what happens instead of the expected behavior -->

### Expected Behavior
Prints:
```
False
False
```
<!--- Tell us what should happen -->

### Steps to Reproduce
See above.
<!--- Provide a minimal example that reproduces the bug -->

### Environment

<!--- Please provide details about your local environment -->

Python version: 3.11.0
NetworkX version: 3.0rc1

### Additional context

<!--- Add any other context about the problem here, screenshots, etc. -->



Discussion:
I can verify that these two graphs should not return an isomorphism and that the vf2pp code does. I can also verify (using `nx.vf2pp_all_isomorphisms`) that the isomorphism yielded is the isomorphism between the non-multiedge version of those two graphs. The VF2 version of the code verifies that the non-multiedge version of those two graphs are isomorphic with that same isomorphism. 

Side note: in my looking at adding VF2++ subgraph isomorphism, I have noticed that some parts of the existing isomorphism code indicate they are checking MultiGraphs, but only check for self-loops. So that might be a place to start debugging this.

Here is some code to reproduce my findings:
```python
import networkx as nx
g = nx.MultiDiGraph({0: [1, 1, 2, 2, 3], 1: [2, 3, 3], 2: [3]})
h = nx.MultiDiGraph({0: [1, 1, 2, 2, 3], 1: [2, 3, 3], 3: [2]})
print(nx.is_isomorphic(g, h))  # False
print(nx.vf2pp_is_isomorphic(g, h))  # True

list((nx.isomorphism.vf2pp_all_isomorphisms(g, h))   # output:  [{0: 0, 1: 1, 2: 3, 3: 2}]

G = nx.DiGraph(g)
H = nx.DiGraph(h)
list((nx.isomorphism.vf2pp_all_isomorphisms(G, H))   # output:  [{0: 0, 1: 1, 2: 3, 3: 2}]
list(nx.isomorphism.DiGraphMatcher(G, H).isomorphisms_iter())   # output:  [{0: 0, 1: 1, 2: 3, 3: 2}]
list(nx.isomorphism.DiGraphMatcher(g, h).isomorphisms_iter())   # output:  []
```
Thanks very much for this report!

Resolving patch:
diff --git a/networkx/algorithms/isomorphism/vf2pp_helpers/feasibility.py b/networkx/algorithms/isomorphism/vf2pp_helpers/feasibility.py
--- a/networkx/algorithms/isomorphism/vf2pp_helpers/feasibility.py
+++ b/networkx/algorithms/isomorphism/vf2pp_helpers/feasibility.py
@@ -232,16 +232,16 @@ def _consistent_PT(u, v, graph_params, state_params):
 
     for predecessor in G1.pred[u]:
         if predecessor in mapping:
-            if G1.number_of_edges(u, predecessor) != G2.number_of_edges(
-                v, mapping[predecessor]
+            if G1.number_of_edges(predecessor, u) != G2.number_of_edges(
+                mapping[predecessor], v
             ):
                 return False
 
     for predecessor in G2.pred[v]:
         if predecessor in reverse_mapping:
             if G1.number_of_edges(
-                u, reverse_mapping[predecessor]
-            ) != G2.number_of_edges(v, predecessor):
+                reverse_mapping[predecessor], u
+            ) != G2.number_of_edges(predecessor, v):
                 return False
 
     return True


Test patch:
diff --git a/networkx/algorithms/isomorphism/tests/test_isomorphvf2.py b/networkx/algorithms/isomorphism/tests/test_isomorphvf2.py
--- a/networkx/algorithms/isomorphism/tests/test_isomorphvf2.py
+++ b/networkx/algorithms/isomorphism/tests/test_isomorphvf2.py
@@ -401,3 +401,9 @@ def test_monomorphism_edge_match():
 
     gm = iso.DiGraphMatcher(G, SG, edge_match=iso.categorical_edge_match("label", None))
     assert gm.subgraph_is_monomorphic()
+
+
+def test_isomorphvf2pp_multidigraphs():
+    g = nx.MultiDiGraph({0: [1, 1, 2, 2, 3], 1: [2, 3, 3], 2: [3]})
+    h = nx.MultiDiGraph({0: [1, 1, 2, 2, 3], 1: [2, 3, 3], 3: [2]})
+    assert not (nx.vf2pp_is_isomorphic(g, h))