Search Results

Search found 3826 results on 154 pages for 'graph theory'.

Page 7/154 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Find the shortest path in a graph which visits certain nodes.

    - by dmd
    I have a undirected graph with about 100 nodes and about 200 edges. One node is labelled 'start', one is 'end', and there's about a dozen labelled 'mustpass'. I need to find the shortest path through this graph that starts at 'start', ends at 'end', and passes through all of the 'mustpass' nodes (in any order). ( http://3e.org/local/maize-graph.png / http://3e.org/local/maize-graph.dot.txt is the graph in question - it represents a corn maze in Lancaster, PA)

    Read the article

  • Need some help understanding this problem about maximizing graph connectivity

    - by Legend
    I was wondering if someone could help me understand this problem. I prepared a small diagram because it is much easier to explain it visually. Problem I am trying to solve: 1. Constructing the dependency graph Given the connectivity of the graph and a metric that determines how well a node depends on the other, order the dependencies. For instance, I could put in a few rules saying that node 3 depends on node 4 node 2 depends on node 3 node 3 depends on node 5 But because the final rule is not "valuable" (again based on the same metric), I will not add the rule to my system. 2. Execute the request order Once I built a dependency graph, execute the list in an order that maximizes the final connectivity. I am not sure if this is a really a problem but I somehow have a feeling that there might exist more than one order in which case, it is required to choose the best order. First and foremost, I am wondering if I constructed the problem correctly and if I should be aware of any corner cases. Secondly, is there a closely related algorithm that I can look at? Currently, I am thinking of something like Feedback Arc Set or the Secretary Problem but I am a little confused at the moment. Any suggestions? PS: I am a little confused about the problem myself so please don't flame on me for that. If any clarifications are needed, I will try to update the question.

    Read the article

  • Shortest acyclic path on directed cyclic graph with negative weights/cycles

    - by Janathan
    I have a directed graph which has cycles. All edges are weighted, and the weights can be negative. There can be negative cycles. I want to find a path from s to t, which minimizes the total weight on the path. Sure, it can go to negative infinity when negative cycles exist. But what if I disallow cycles in the path (not in the original graph)? That is, once the path leaves a node, it can not enter the node again. This surely avoids the negative infinity problem, but surprisingly no known algorithm is found by a search on Google. The closest is Floyd–Warshall algorithm, but it does not allow negative cycles. Thanks a lot in advance. Edit: I may have generalized my original problem too much. Indeed, I am given a cyclic directed graph with nonnegative edge weights. But in addition, each node has a positive reward too. I want to find a simple path which minimizes (sum of edge weights on the path) - (sum of node rewards covered by the path). This can be surely converted to the question that I posted, but some structure is lost. And some hint from submodular analysis suggests this motivating problem is not NP-hard. Thanks a lot

    Read the article

  • Unable to retrieve search results from server side : Facebook Graph API usig Python

    - by DjangoRocks
    Hi all, I'm doing some simple Python + FB Graph training on my own, and I faced a weird problem: import time import sys import urllib2 import urllib from json import loads base_url = "https://graph.facebook.com/search?q=" post_id = None post_type = None user_id = None message = None created_time = None def doit(hour): page = 1 search_term = "\"Plastic Planet\"" encoded_search_term = urllib.quote(search_term) print encoded_search_term type="&type=post" url = "%s%s%s" % (base_url,encoded_search_term,type) print url while(1): try: response = urllib2.urlopen(url) except urllib2.HTTPError, e: print e finally: pass content = response.read() content = loads(content) print "==================================" for c in content["data"]: print c print "****************************************" try: content["paging"] print "current URL" print url print "next page!------------" url = content["paging"]["next"] print url except: pass finally: pass """ print "new URL is =======================" print url print "==================================" """ print url What I'm trying to do here is to automatically page through the search results, but trying for content["paging"]["next"] But the weird thing is that no data is returned; i received the following: {"data":[]} Even in the very first loop. But when i copied the URL into a browser, a lot of results were returned. I've also tried a version with my access token and th same thing happens. Can anyone enlighten me? +++++++++++++++++++EDITED and SIMPLIFIED++++++++++++++++++ ok thanks to TryPyPy, here's the simplified and edited version of my previous question: Why is that: import urllib2 url = "https://graph.facebook.com/searchq=%22Plastic+Planet%22&type=post&limit=25&until=2010-12-29T19%3A54%3A56%2B0000" response = urllib2.urlopen(url) print response.read() result in {"data":[]} ? But the same url produces a lot of data in a browser? Anyone? Best Regards.

    Read the article

  • Safe way for getting/finding a vertex in a graph with custom properties -> good programming practice

    - by Shadow
    Hi, I am writing a Graph-class using boost-graph-library. I use custom vertex and edge properties and a map to store/find the vertices/edges for a given property. I'm satisfied with how it works, so far. However, I have a small problem, where I'm not sure how to solve it "nicely". The class provides a method Vertex getVertex(Vertexproperties v_prop) and a method bool hasVertex(Vertexproperties v_prop) The question now is, would you judge this as good programming practice in C++? My opinion is, that I have first to check if something is available before I can get it. So, before getting a vertex with a desired property, one has to check if hasVertex() would return true for those properties. However, I would like to make getVertex() a bit more robust. ATM it will segfault when one would directly call getVertex() without prior checking if the graph has a corresponding vertex. A first idea was to return a NULL-pointer or a pointer that points past the last stored vertex. For the latter, I haven't found out how to do this. But even with this "robust" version, one would have to check for correctness after getting a vertex or one would also run into a SegFault when dereferencing that vertex-pointer for example. Therefore I am wondering if it is "ok" to let getVertex() SegFault if one does not check for availability beforehand?

    Read the article

  • graph algorithms on GPU

    - by scatman
    the current GPU threads are somehow limited (memory limit, limit of data structures, no recursion...). do you think it would be feasible to implement a graph theory problem on GPU. for example vertex cover? dominating set? independent set? max clique?.... is it also feasible to have branch-and-bound algorithms on GPUs? Recursive backtracking?

    Read the article

  • Graph and permutation problem

    - by user319771
    I have a graph (with nodes and edges) containing symmetry and a group of permutations to label the nodes so no edges are changed (automorphisms). Now I would like to determine for which nodes a permutation exchanges two equivalent (i.e. nodes with the same color or symmetry class) neighboring nodes. When the nodes with equivalent neighbors stay the same, simply checking if the neighbors are exchanged in the permutation is enough. However, when the nodes with equivalent neighbors are also permuted (i.e. there are multiple nodes with the same color/symmetry class with the same equivalent neighbors), the problem becomes more complex. Is there any known algorithm for such a problem? Some remarks: The graph has no coordinates, it's a topology only

    Read the article

  • Timeline graph - how to handle "time gaps"?

    - by ebae
    I've been working with Google chart API and annotated timeline. Drawing graphs is fine. I have no problem. However, I need to draw a timeline graph for share prices. And as you may know, share prices are meaningful only between certain times (e.g. from 10AM to 4PM, when the market opens and closes). How do I change the Google timeline graph so that on X-Axis, the range is from 10AM-4PM? Right now, it just draws a long constant line between 4PM till 10AM next day before prices start to move again. Man, I hope that makes sens. (Google finance chart seems to do it). Thank you SO much for whoever can answer. You are a CHAMPION!

    Read the article

  • Boost graph libraries: setting edge weight values

    - by AndyUK
    I am investigating the use of the boost graph libraries in order to apply them to various network problems I have in mind. In the examples I have been looking at the graph edge values ("weights") are always initialized as integers, such as in these Bellman-Ford and Kruskal algorithms eg: int weights[] = { 1, 1, 2, 7, 3, 1, 1, 1 }; My problem is if I try and change the weights to double, I get a heap of warning messages about conversions etc, which so far I have not been able to figure out how to overcome. Does anyone see a way around this?

    Read the article

  • Graph visualization code in javascript?

    - by Chris Farmer
    Hi. I have a data structure that represents a directed graph, and I want to render that dynamically on an HTML page. Does anyone know of any javascript code that can do a reasonable job with graph layout? These graphs will usually be just a few nodes, maybe ten at the very upper end, so my guess is that performance isn't going to be a big deal. Ideally, I'd like to be able to hook it in with jQuery so that users can tweak the layout manually by dragging the nodes around. Edit: Google's Visualization API seems to be more "graphs as charts" oriented than "graphs as nodes" oriented. I didn't see any node-oriented visualizations already built there, anyway. Do you know that one exists?

    Read the article

  • Getting specific data from via facebook graph api

    - by Sima
    Hi, is there any possibility how to fetch any specific type of posts from facebook news feed via graph api?For example on my news feed I have statutuses, links, photos, vidoes, and so on..I only want to get the ones with type=status over graph api..I have seen some get parameters in documentation, but nothing like ?type=link..So I have tried /me/home?type=link, but unsurprisingly it have not worked:D So does anyone know how to do that?I can filter it in my PHP app, but then I need to get some further data..When I got 20 posts and only 10 would be statuses, I need to add the 10 remaiming? It is too possible, but I dont know how to do that:D Please help..!Thanks

    Read the article

  • Facebook Graph - does the user "like" my page?

    - by Ican Zilb
    I am trying to upgrade my iPhone app to use the new facebook graph api. One thing I cannot find is how to find out if the current user connected from my app to facebook is a fan of my facebook page - (i.e. in the new paradigm - whether the user likes my page) In the Rest Api there was a function isFan, but not in the Graph. I can get all items the user likes and search whether one of them is my page, but certainly there must be an easier way instead of going trough thousands of records each time I must check whether he is a fan, right? If someone already figured it out how to do that from their new docs, I'll really appreciate if you share it with me.

    Read the article

  • Facebook Open Graph Not Showing Object Title

    - by gregavola
    I'm having conflicting reports for our users that people that share Object Graph objects to their wall, are sometimes showing the Object title and other times not. Specifically, every test I do on my own account shows the Object Title, but on their Mobile apps - it doesn't appear. I've tested the Open Graph debugger.So I have a couple of questions: Is there a length limit on the number of characters? Does Facebook not show the whole Object.title on Mobile? Does Facebook scrap the OG tags and if it can't find them or if it timeout do they not receive them? Here is my sample OG url: https://untappd.com/user/gregavola/checkin/35486976 Response from FB: Post on my Wall: What can I do here? What am I missing?

    Read the article

  • CSS Graph- Bars not showing correctly

    - by Olivia
    I'm trying to create a CSS/HTML based graph using this tutorial here. However instead of putting the data directly into the html code I'm importing it from a CSV file using PHP with the following code. <?PHP /* Open CSV file */ $handle = fopen("defects.csv", "r"); $c = 0; /* gets data from csv file */ while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { /* stores dates as variable $date */ $date[$c] = $data[0]; $c++; /* inserts defect data into html code */ echo "<dd class=\"p" . $data[2] . "\"><span><b>" . $data[2] . "</b></span></dd>"; echo "<dd class=\"sub p" . $data[3] . "\" ><span><b>" . $data[3] . "</b></span></dd>"; } echo "</dl>"; echo "<ul class=\"xAxis\">"; /* X AXIS */ /* inserts date data into html code for x axis */ for ($d=0; $d < $c; $d++) { echo "<li>" . $date[$d] . "</li>"; } ?> The values are being placed correctly on the chart, but the bars aren't appearing. The CSS code I have for the bars is: /* default column styling */ dl#csschart span{ height:50%; background:url(../images/barx.png) repeat-y; } dl#csschart .sub{ margin-left:-33px; } dl#csschart .sub span{ background:url(../images/subBarx.png) repeat-y; } Just in case it helps, I've print screened how the graph should look. You can see it at: http://allured.info/graph/failgraph.png

    Read the article

  • VB.net Network Graph code/algorithm

    - by Jens
    For a school project we need to visualise a computer network graph. The number of computers with specific properties are read from an XML file, and then a graph should be created. Ad random computers are added and removed. Is there any open source project or algorithm that could help us visualising this in VB.net? Or would you suggest us to switch to java. Update: We eventually switched java and used the Jung libraries because this was easier for us to understand and implement.

    Read the article

  • representing graph using database

    - by prosseek
    I need to represent graph information with database. Let's say, a is connected to b, c, and d. a -- b |_ c |_ d I can have a node table for a, b, c, and d, and I can also have a link table (FROM, TO) - (a,b), (a,c), (a,d). For other implementation there might be a way to store the link info as (a,b,c,d), but the number of elements in the table is variable. Q1 : Is there a way to represent variable elements in a table? Q2 : Is there any general way to represent the graph structure using database?

    Read the article

  • Find a node in a Graph that minimizes the distance between two other nodes

    - by Andrés
    Here is the thing. I have a directed weighted graph G, with V vertices and E edges. Given two nodes in the graph, let's say A, and B, and given the weight of an edge A-B denoted as w(A, B), I need to find a node C so that max(w(A, C), w(B, C)) is minimal among all possibilities. By possibilities I mean all the values C can take. I don't know if it is completely clear, if it's not, I'll try to be more precise. Thanks in advance.

    Read the article

  • Structure of Astar (A*) graph search data in C#

    - by Shawn Mclean
    How do you structure you graphs/nodes in a graph search class? I'm basically creating a NavMesh and need to generate the nodes from 1 polygon to the other. The edge that joins both polygons will be the node. I'll then run A* on these Nodes to calculate the shortest path. I just need to know how to structure my classes and their properties? I know for sure I wont need to create a fully blown undirected graph with nodes and edges.

    Read the article

  • Weakly connected balanced digraph

    - by user1074557
    How can I prove that if a balanced digraph is weakly connected, then it is also strongly connected? (balanced digraph means that for every node, it's indegree and outdegree is the same and weakly connected means the non-directed version of this graph is connected). What I can think of so far is: if the graph is balanced, it means it is a union of directed cycles. So if I remove any cycle, it will stay balanced. Also each vertex in the cycle has one edge coming into it and one edge leading out of it.. Then I guess I need to use some contradiction or induction to prove that the graph is strongly connected.. That's where I confused.

    Read the article

  • Resources on concepts/theory behind GUI development?

    - by ShrimpCrackers
    I was wondering if there were any resources that explain concepts/theory behind GUI development. I don't mean a resource that explains how to use a GUI library, but rather how to create your own widgets. For example a resource that explains different methods on how to implement scrollable listboxes. I ask because I have an idea for a game tool where I would like to create my own widgets and let users drag and drop them onto some kind of form. How do GUI libraries usually draw widgets? I'm not sure if reskinning widgets from a GUI library fits my needs, since widget behavior needs to be dynamic based on user interaction.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >