@Override public synchronized boolean isDirected() { return delegate.isDirected(); }
@Override public boolean isDirected() { return delegate.isDirected(); }
/** * Constructs and initializes the algorithm. * * @param graph the graph whose nodes are being measured for their importance * @param nodeFactory used to generate instances of V * @param edgeFactory used to generate instances of E * @param alpha the path decay coefficient (≥1); 2 is recommended * @param maxDepth the maximal depth to search out from the root set * @param priors the root set (starting nodes) */ public WeightedNIPaths( MutableNetwork<N, E> graph, Supplier<N> nodeFactory, Supplier<E> edgeFactory, double alpha, int maxDepth, Set<N> priors) { // TODO: is this actually restricted to only work on directed graphs? Preconditions.checkArgument(graph.isDirected(), "Input graph must be directed"); this.graph = graph; this.nodeFactory = nodeFactory; this.edgeFactory = edgeFactory; this.alpha = alpha; this.maxDepth = maxDepth; this.priors = priors; evaluate(); }
if (a_pred.test(nextLine)) { Preconditions.checkState( g.isDirected(), "Supplied undirected-only graph cannot be populated with directed edges"); reading_arcs = true; !g.isDirected(), "Supplied directed-only graph cannot be populated with undirected edges"); reading_edges = true;
private WeightedChoice<N> buildNodeProbabilities() { Map<N, Double> item_weights = new HashMap<N, Double>(); for (N v : graph.nodes()) { double degree; double denominator; // Attachment probability is dependent on whether the graph is // directed or undirected. if (graph.isDirected()) { degree = graph.inDegree(v); denominator = graph.edges().size() + graph.nodes().size(); } else { degree = graph.degree(v); denominator = (2 * graph.edges().size()) + graph.nodes().size(); } double prob = (degree + 1) / denominator; item_weights.put(v, prob); } WeightedChoice<N> nodeProbabilities = new WeightedChoice<N>(item_weights, mRandom); return nodeProbabilities; }
if (picked.size() > 0) { JMenu menu = new JMenu("Create " + (graph.isDirected() ? "Directed" : "Undirected") + " Edge"); popup.add(menu); for (final N other : picked) {
if (graph.isDirected()) { Set<EndpointPair<N>> endpointPairs = graph.edges().stream().map(graph::incidentNodes).collect(toSet());