subgraph

Creating Subgraph using igraph in R

亡梦爱人 提交于 2019-12-30 07:26:24
问题 I need to obtain a subgraph of the seed nodes (the input list of nodes; file.txt) and their first interactors (neighbours) from a graph (g) using igraph. Unfortunately, I am ending up with only a single node in the subgraph, and not all the rest of the nodes and edges (vertices) which interlink them. g<-read.graph("DATABASE.ncol",format="ncol",directed=FALSE) #load the data g2<-simplify(g, remove.multiple=TRUE, remove.loops=TRUE) # Remove the self-loops in the data DAT1 <- readLines("file.txt

minimum connected subgraph containing a given set of nodes

一世执手 提交于 2019-12-30 02:44:06
问题 I have an unweighted, connected graph. I want to find a connected subgraph that definitely includes a certain set of nodes, and as few extras as possible. How could this be accomplished? Just in case, I'll restate the question using more precise language. Let G(V,E) be an unweighted, undirected, connected graph. Let N be some subset of V. What's the best way to find the smallest connected subgraph G'(V',E') of G(V,E) such that N is a subset of V'? Approximations are fine. 回答1: I can't think

Extract subgraph in neo4j

白昼怎懂夜的黑 提交于 2019-12-28 13:59:50
问题 I have a large network stored in Neo4j. Based on a particular root node, I want to extract a subgraph around that node and store it somewhere else. So, what I need is the set of nodes and edges that match my filter criteria. Afaik there is no out-of-the-box solution available. There is a graph matching component available, but it works only for perfect matches. The Neo4j API itself defines only graph traversal which I can use to define which nodes/edges should be visited: Traverser exp =

Neo4J: find a sub-graph of arbitrary depth with nodes connected by a given set of relations?

你说的曾经没有我的故事 提交于 2019-12-25 06:28:09
问题 How to build a Neo4J query that: 1) Will return all nodes in a sub-graph of arbitrary depth with nodes connected by a given set of relations? For example in Cypher-like syntax: MATCH (*)-[r1:FRIEND_OF AND r2:COLLEAGUE_WITH]->(*) RETURN * 回答1: This query will return just the nodes, as you stated in your question: MATCH (n)-[:FRIEND_OF|COLLEAGUE_WITH*]->(m) RETURN n, m; If you also want the relationships: MATCH (n)-[r:FRIEND_OF|COLLEAGUE_WITH*]->(m) RETURN n, r, m; 来源: https://stackoverflow.com

Tensorflow : how to insert custom input to existing graph?

天大地大妈咪最大 提交于 2019-12-21 02:45:57
问题 I have downloaded a tensorflow GraphDef that implements a VGG16 ConvNet, which I use doing this : Pl['images'] = tf.placeholder(tf.float32, [None, 448, 448, 3], name="images") #batch x width x height x channels with open("tensorflow-vgg16/vgg16.tfmodel", mode='rb') as f: fileContent = f.read() graph_def = tf.GraphDef() graph_def.ParseFromString(fileContent) tf.import_graph_def(graph_def, input_map={"images": Pl['images']}) Besides, I have image features that are homogeneous to the output of

Subgraph layout in graphviz

喜欢而已 提交于 2019-12-12 08:03:08
问题 I have code to display two subgraphs: graph { rankdir=LR; subgraph cluster01 { label="t=0" a0 [label="A"]; a1 [label="B"]; a2 [label="C"]; a5 [label="E"]; a0 -- a1; a1 -- a2 ; a2 -- a0; }; subgraph cluster02 { label="t=10" b0 [label="A"]; b5 [label="E"]; b1 [label="B"]; b2 [label="C"]; b0 -- b1; b2 -- b5; }; a0--b0 [style=dotted]; a1--b1 [style=dotted]; a2--b2 [style=dotted]; a5--b5 [style=dotted]; } This code displays two subgraphs like this: But I want to have it like this: I hope someone

subset igraph object to just 2nd order ego graph of certain vertices

杀马特。学长 韩版系。学妹 提交于 2019-12-12 05:27:58
问题 Building off this question here, is there a way to extend this subgraph to include vertices connected by two degrees to a subset of vertices? I'm thinking of a command similar to the functions in make_ego_graph() where order=2 and mode="in". I'm working with a directed graph object. Thus far, I've come up with the following, but it's not producing the graph I'm looking for. first_degree <- V(graph)$condition == "something" second_degree <- V(graph)[to(first_degree)] edges_subset <- E(graph)

How to extract a subgraph from a dot file

自古美人都是妖i 提交于 2019-12-11 14:44:08
问题 I have a dot file generated by a software called egypt. The dot file contains many nodes and edges. If I use this dot file to draw a picture, it is very hard see the picture clearly as there are too many nodes. And what I need is only a subgraph starting from a node, and I don't need the whole picture. Is there any way to draw a subgraph from a specified node (such as start_node) using this dot file? 来源: https://stackoverflow.com/questions/46462155/how-to-extract-a-subgraph-from-a-dot-file

How to align subgraphs in dot files

霸气de小男生 提交于 2019-12-11 11:13:21
问题 I am trying to align three or more subgraphs using dot files and graphviz. I think my problem is best shown using a few examples: My first try: digraph FutopJobFlow { rankdir=LR; node [shape=box] compound=true subgraph clusterA {label = " A "; A -> a1; a1 -> a2; a2 -> a3; } subgraph clusterB {label = " B "; B -> b1; b1 -> b2; } subgraph clusterC {label = " C "; C -> c1; c1 -> c2; } A -> B [lhead=clusterB]; B -> C [lhead=clusterC]; X -> A [lhead=clusterA]; Y -> B [lhead=clusterB]; Z -> C

How many Complete Graph present in given undirected Graph?

孤人 提交于 2019-12-11 02:42:12
问题 Is there a known algorithm to find all complete sub-graphs within a graph? I have an undirected, graph and I need to find all complete graphs present in that undirected graph. Is there an existing algorithm for this? 来源: https://stackoverflow.com/questions/30389474/how-many-complete-graph-present-in-given-undirected-graph