Search Results

Search found 2471 results on 99 pages for 'graph'.

Page 15/99 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • How to draw the graph in android based on its height and size

    - by Rakesh
    i want to draw a graph in a area and i used a linear layout as area.i want to set the size of the graph area,which should be compatible to small,medium ,default emulators etc.i need to set the size for graph area,how can i do it in xml file for eg in blackberry we use Display.getWidth();Similar is there way to get the width of the display either programmatically or in xml Regards Rakesh Shankar.p

    Read the article

  • BFS traversal of directed graph from a given node

    - by p1
    Hi, My understanding of basic BFS traversal for a graph is: BFS { Start from any node . Add it to que. Add it to visited array While(que is not empty) { remove head from queue. Print node; add all unvisited direct subchilds to que; mark them as visited } } However, if we have to traverse a DIRECTED graph from a given node and not all nodes are accessible from the given node [directly or indirectly] how do we use BFS for the same. Can you please explain in this graph as well: a= b = d = e = d a= c = d Here if the starting node is b , we never print a and c. Am I missing something in the algorithm. P.S: I used "HashMap adj = new HashMap();" to create the adjacencey list to store graph Any pointers are greatly appreciated. Thanks.

    Read the article

  • Plot a graph using .NET

    - by veda
    I need to read some data from an input file and plot a graph based on the inputs... I want to plot a graph using visual C#. Is there any in-built functions to plot a graph in visual C#.. If not, how can I do that..

    Read the article

  • Creating an adjacency Matrix from a JUNG Graph.

    - by prince
    Graph < Integer, Integer> g = new SparseMultigraph<Integer, Integer>(); g.addVertex(1);g.addVertex(2);g.addVertex(3); g.addEdge(0,1,2 ,EdgeType.DIRECTED);g.addEdge(1,2,3 ,EdgeType.DIRECTED);g.addEdge(2,3,1 ,EdgeType.DIRECTED);g.addEdge(3,1,3 ,EdgeType.DIRECTED); How can I convert this graph into an adjacency matrix taking into consideration that it is a directed graph.

    Read the article

  • Conky graph frozen in time

    - by dijxtra
    Is it possible to plot a graph in conky? Give a function a set of values 0-100 and conky plots a graph similar to execgraph? What I want is to visualize how a variable changed in last week. For example, I'd like to make a graph of gold prices in last 14 days. One way I could do that is use "execigraph 86400 python fetch_price_of_gold.py" and keep my box up 24/7 and eventually I'd get a nice graph. But, unfortunately my box isn't up 24/7. Not to mention I'd have to wait 14 days after every reboot ;-) So, any other ideas? :-)

    Read the article

  • facebook graph api don´t publish to news feed

    - by rizidoro
    hi, im trying to update my news feed on facebook. Im using the new graph api. I can connect to graph, but when i try to publish some content to the feed object, nothing happens. here´s my code: <?php $token = "xxxx"; $fields = "message=test&access_token=$token"; $c = curl_init("http://graph.facebook.com/me/feed"); curl_setopt($c,"CURLOPT_POST", true); curl_setopt($c,"CURLOPT_POSTFIELDS",$fields); $r = curl_exec($c); print_r($r); this returns: {"error":{"type":"QueryParseException","message":"An active access token must be used to query information about the current user."}}1 then I try to pass access_token via GET: $c = curl_init("http://graph.facebook.com/me/feed?access_token=$token"); this returns: {"data":[]}1 Am I doing something wrong? thanks

    Read the article

  • graph algorithms

    - by davit-datuashvili
    now one ask please help me to write a few graph algorithms for example http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm there is given such graph my problem is that i want implement graph algorithms on arrays can anybody help me to imlement ddijkstra algorithm on array i want to see one example because it is difficulty for me to understand this pseudocodes which is in internet i mean classes edges and so on please help me

    Read the article

  • steps for facebook connect graph api

    - by dskanth
    Hi, iam using facebook connect in my site, and i want to know how do i use the graph api for authenticating the user. I followed these steps: 1) Initially i sent a request for "code", by clicking on the facebook icon in my site: https://graph.facebook.com/oauth/authorize? client_id=xxx&redirect_uri=http://xxxxxxxx 2) And then after getting a code, i sent a request for "access token", by clicking on another link in my site: https://graph.facebook.com/oauth/access_token? client_id=xxx&redirect_uri=http://xxxxxxx&client_secret=xxxx&code=xxxxx 3) And after i got the token, i sent another request for getting user data, by clicking on yet another link: https://graph.facebook.com/me?access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Then finally i got the user data in array format, which i need to parse for my required data like user's firstname, email, etc. Now my question is that how i can automate this process with just one click ? Right now, iam using 3 different links for sending those requests. Can anyone suggest a solution ?

    Read the article

  • Using Flot's Bar Graph in an Android WebView with Highlighting

    - by Nicholi
    The issue is unhighlighting bars which are no longer selected in a bar graph plotted by flot in a WebView on Android. Got no other issues drawing the actual graphs (which look beautiful for something so simple btw). I am not extremely knowledgeable in terms of javascript and web design/development but it seems little should have been needed, if it would just work!! :( I believe I'm following the Flot API correctly, if not someone please scream and yell at me. It seems to work just fine in a non-mobile browser at least. Hoping someone has done this before, but if not I've got the minimal necessary code to poke at your droids if inquiring minds would like to test. I've tested on two Nexus Ones (both 2.2.1), and have tried targeting with Andriod 1.5 and 2.2 SDKs (my intention is to target 1.5 if possible). I've been attempting to hack away at this for far too long on my own now. What happens: 1. Graph loads fine with bars. All bars unhighlighted. 2. Select a bar in graph, gets highlighted fine (and a tooltip is placed). 3. Select a different bar in graph, old bar is unhighlighted, old tooltip removed, new bar highlighted and tooltip placed (still no problems). 4. Click in the vast darkness of the graph which should then unhighlight the last bar... but it doesn't. I've tried disabling flot's autohighlight and manually doing it as well to no avail. Looking into flot itself and only getting down to drawOverlay() where the issue seems to begin... An even more disturbing bug(?) appears if the fill bar option is enabled in the graph, but I'd rather just forget about that for now. Also grabbed the latest version of flot from their svn (r290), but made no different from last public release (v0.6). As a complete guess I'm thinking it's an issue with WebKit's javascript implementation (or something specific to Nexus Ones, which wouldn't be so bad), but if there is any ugly hack to just get it to work I'm all ears. I've thrown the graph data directly into the html/js, rather than deal with showing all the code involved in the Java-javascript handler and callbacks. The simple html placed in 'assets/flot/test/' with jquery.js and jquery.flot.js: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="jquery.js"></script> <script src="jquery.flot.js"></script> <script id="source" language="javascript" type="text/javascript"> var lastItem = null; var plot = null; $(document).ready(function () { //window.testhandler.loadGraph(); // bind plotclick here $("#graphHolder").bind("plotclick", function (event, pos, item) { if (item) { var lastPoint = null; if (lastItem != null) lastPoint = lastItem.datapoint; if (!pointEquals(lastPoint, item.datapoint)) { //if (lastItem != null) // plot.unhighlight(lastItem.series, lastItem.datapoint); lastItem = item; $("#tooltip").remove(); //plot.highlight(item.series, item.datapoint); showTooltip(item.pageX, item.pageY, item.datapoint[1]); } } else if (lastItem != null) { plot.unhighlight(lastItem.series, lastItem.datapoint); // not unhighlighting anything //plot.unhighlight(); // doesn't work either, supposed to unhighlight everything lastItem = null; $("#tooltip").remove(); } }); GotGraph(); }); /** * Show a tooltip above bar in graph * @param {int} x Left coordinate of div * @param {int} y Top coordinate of div * @param {String} contents text to place in div */ function showTooltip(x, y, contents) { $('<div id="tooltip">' + contents + '</div>').css( { position: 'absolute', display: 'none', top: y, left: x, border: '1px solid #fdd', padding: '2px', 'background-color': '#fee', opacity: 0.80 }).appendTo("body").fadeIn(200); } /** * Draw the graph. This is a callback which will be called by Java * * @param {Object} seriesData * @param {Object} seriesOptions */ function GotGraph() { //seriesData, seriesOptions) { var seriesData = [{ "bars":{"lineWidth":2,"show":true,"barWidth":86400000,"align":"center","fill":false}, "data":[[1288569600000,10],[1288656000000,5],[1288742400000,12],[1288828800000,20],[1288915200000,14],[1289001600000,3],[1289174400000,22],[1289260800000,20],[1289347200000,10],[1289433600000,5],[1289520000000,12],[1289606400000,20],[1289692800000,14],[1289779200000,35]]}]; var seriesOptions = { "xaxis":{"twelveHourClock":false,"minTickSize":[1,"day"],"tickSize":[1,"day"],"timeformat":"%d","mode":"time"}, "yaxis":{"min":0}, "grid":{"clickable":true,"autoHighlight":true,"hoverable":false}}; plot = $.plot($("#graphHolder"), seriesData, seriesOptions); } function pointEquals(point1, point2) { if (point1 != null && point2 != null && typeof(point1) == typeof(point2) && point1.length == point2.length) { var i; for (i=0;i<point1.length;i++) { if (point1[i] != point2[i]) { return false; } } return true; } return false; } </script> </head> <body> <div id="graphHolder" STYLE="height:200px;width:400px"></div> </body> </html> The minimal amount of code necessary in onCreate in startup activity: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); WebView mytestView = new WebView(this); mytestView.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); setContentView(mytestView); mytestView.setBackgroundColor(0); mytestView.getSettings().setJavaScriptEnabled(true); mytestView.setClickable(true); mytestView.setFocusable(false); mytestView.setFocusableInTouchMode(false); mytestView.loadUrl("file:///android_asset/flot/test/stats_graph.html"); }

    Read the article

  • Social Network directed Graph Library? .NET

    - by MRFerocius
    Hello everybody, I am on a project where I have multiple users of a portal and they are connected to other users of the portal, now we are asked to draw a "Social Network" relationship graph to see the relationships. The constraint is that this graph has to be seen on the WEB BROWSER. The graph has to be something like: Is there any C# library or component to draw this type of graphs? We have already checked these: http://flare.prefuse.org/ http://www.yworks.com/en/products_yfiles_practicalinfo_gallery.html .NET graph library around? http://quickgraph.codeplex.com/ https://graphsharp.codeplex.com/ http://research.microsoft.com/en-us/downloads/f1303e46-965f-401a-87c3-34e1331d32c5/default.aspx http://sourceforge.net/projects/zedgraph/ But I want to check if you already used some other and your feedback... Thanks in advanced!

    Read the article

  • Seperating two graphs based on connectivity and coordinates

    - by martin
    I would like to separate existing data of vertices and edges into two or more graphs that are not connected. I would like to give the following as example: Imagine two hexagons on top of each other but are lying in different Z. Hexagon 1 has the following vertices A(0,0,1), B(1,0,2), C(2,1,2), D(1,2,1), E(0,2,1), F(-1,2,1). The connectivity is as following: A-B, B-C, C-D, D-E, E-F, F-A. This part of Graph 1 as all the vertices are connected in this layer. Hexagon2 has the following vertices A1(0,0,6), B1(1,0,7), C1(2,1,7), D1(1,2,8), E1(0,2,7), F1(-1,2,6). The connectivity is as following: A1-B1, B1-C1, C1-D1, D1-E1, E1-F1, F1-A1. This is part of Graph 2 My data is in the following form: list of Vertices and list of Edges that i can form graphs with. I would like to eliminate graph 2 and give only vertices and connectivity of graph 1 to polygon determination part of my algorithm. My real data contains around 1000 connected polygons as graph 1 and around 100 (much larger in area) polygons as graph 2. I would like to eliminate graph 2. I am programming this in python. Thanks in advance.

    Read the article

  • Evaluate a Munin graph defined in munin.conf

    - by Ztyx
    Hi, I have defined an additional graph (in Munin, munin.conf) that calculates the total size of my MySQL database. The index and data sizes are extracted from an external plugin. The definition looks like this: [...] [Database;my.host.com] address my.host.com use_node_name yes dbsize.update no dbsize.graph_args --base 1024 -l 0 dbsize.graph_title Total database size dbsize.graph_vlabel bytes dbsize.graph_category mysql dbsize.graph_info The total database size. dbsize.graph_order the_sum dbsize.the_sum.sum \ my.host.com:mysql_size.index \ my.host.com:mysql_size.datas dbsize.the_sum.label data+index dbsize.the_sum.type GAUGE dbsize.the_sum.min 0 [...] Now, is it possible to extract the current value of this graph? Running # munin-run dbsize or # munin-run my.host.com:dbsize does not seem to work.

    Read the article

  • Combinations into pairs

    - by Will
    I'm working on a directed network problem and trying to compute all valid paths between two points. I need a way to look at paths up to 30 "trips" (represented by an [origin, destination] pair) in length. The full route is then composed of a series of these pairs: route = [[start, city2], [city2, city3], [city3, city4], [city4, city5], [city5, city6], [city6, city7], [city7, city8], [city8, stop]] So far my best solution is as follows: def numRoutes(graph, start, stop, minStops, maxStops): routes = [] route = [[start, stop]] if distance(graph, route) != "NO SUCH ROUTE" and len(route) >= minStops and len(route) <= maxStops: routes.append(route) if maxStops >= 2: for city2 in routesFromCity(graph, start): route = [[start, city2],[city2, stop]] if distance(graph, route) != "NO SUCH ROUTE" and len(route) >= minStops and len(route) <= maxStops: routes.append(route) if maxStops >= 3: for city2 in routesFromCity(graph, start): for city3 in routesFromCity(graph, city2): route = [[start, city2], [city2, city3], [city3, stop]] if distance(graph, route) != "NO SUCH ROUTE" and len(route) >= minStops and len(route) <= maxStops: routes.append(route) if maxStops >= 4: for city2 in routesFromCity(graph, start): for city3 in routesFromCity(graph, city2): for city4 in routesFromCity(graph, city3): route = [[start, city2], [city2, city3], [city3, city4], [city4, stop]] if distance(graph, route) != "NO SUCH ROUTE" and len(route) >= minStops and len(route) <= maxStops: routes.append(route) if maxStops >= 5: for city2 in routesFromCity(graph, start): for city3 in routesFromCity(graph, city2): for city4 in routesFromCity(graph, city3): for city5 in routesFromCity(graph, city4): route = [[start, city2], [city2, city3], [city3, city4], [city4, city5], [city5, stop]] if distance(graph, route) != "NO SUCH ROUTE" and len(route) >= minStops and len(route) <= maxStops: routes.append(route) return routes Where numRoutes is fed my network graph where numbers represent distances: [[0, 5, 0, 5, 7], [0, 0, 4, 0, 0], [0, 0, 0, 8, 2], [0, 0, 8, 0, 6], [0, 3, 0, 0, 0]] a start city, an end city and the parameters for the length of the routes. distance checks if a route is viable and routesFromCity returns the attached nodes to each fed in city. I have a feeling there's a far more efficient way to generate all of the routes especially as I move toward many more steps, but I can't seem to get anything else to work.

    Read the article

  • Display AxisRenderer outside Flex Chart

    - by Leandro Ardissone
    Hi, Is there a way to display the Vertical Axis outside the graph? I need the limits of the graph to be displayed between the vertical axis, without overlapping the series over the graph. See that screenshot of what I have: I need to get something like: Or I should create a custom axis renderer component that get data from this graph and display it outside?

    Read the article

  • Stata - Multiple rotated plots on graph (including distributions on sides of axes)

    - by meerak
    I would like to produce a single graph containing both: (1) a scatter plot (2) either histograms or kernel density functions of the Y and X variables to the left of the Y axis and below the X axis. I found a graph that does this in MATLAB -- I would just like to produce something similar in Stata: That graph was produced using the following MATLAB code: n = 1000; rho = .7; Z = mvnrnd([0 0], [1 rho; rho 1], n); U = normcdf(Z); X = [gaminv(U(:,1),2,1) tinv(U(:,2),5)]; [n1,ctr1] = hist(X(:,1),20); [n2,ctr2] = hist(X(:,2),20); subplot(2,2,2); plot(X(:,1),X(:,2),'.'); axis([0 12 -8 8]); h1 = gca; title('1000 Simulated Dependent t and Gamma Values'); xlabel('X1 ~ Gamma(2,1)'); ylabel('X2 ~ t(5)'); subplot(2,2,4); bar(ctr1,-n1,1); axis([0 12 -max(n1)*1.1 0]); axis('off'); h2 = gca; subplot(2,2,1); barh(ctr2,-n2,1); axis([-max(n2)*1.1 0 -8 8]); axis('off'); h3 = gca; set(h1,'Position',[0.35 0.35 0.55 0.55]); set(h2,'Position',[.35 .1 .55 .15]); set(h3,'Position',[.1 .35 .15 .55]); colormap([.8 .8 1]); UPDATE: The Stata13 manual entry for "graph combine" has precisely this example (http://www.stata.com/manuals13/g-2graphcombine.pdf). Here is the code: use http://www.stata-press.com/data/r13/lifeexp, clear generate loggnp = log10(gnppc) label var loggnp "Log base 10 of GNP per capita" scatter lexp loggnp, ysca(alt) xsca(alt) xlabel(, grid gmax) fysize(25) saving(yx) twoway histogram lexp, fraction xsca(alt reverse) horiz fxsize(25) saving(hy) twoway histogram loggnp, fraction ysca(alt reverse) ylabel(,nogrid) xlabel(,grid gmax) saving(hx) graph combine hy.gph yx.gph hx.gph, hole(3) imargin(0 0 0 0) graphregion(margin(l=22 r=22)) title("Life expectancy at birth vs. GNP per capita") note("Source: 1998 data from The World Bank Group")

    Read the article

  • Problems with with A* algorithm

    - by V_Programmer
    I'm trying to implement the A* algorithm in Java. I followed this tutorial,in particular, this pseudocode: http://theory.stanford.edu/~amitp/GameProgramming/ImplementationNotes.html The problem is my code doesn't work. It goes into an infinite loop. I really don't know why this happens... I suspect that the problem are in F = G + H function implemented in Graph constructors. I suspect I am not calculate the neighbor F correclty. Here's my code: List<Graph> open; List<Graph> close; private void createRouteAStar(Unit u) { open = new ArrayList<Graph>(); close = new ArrayList<Graph>(); u.ai_route_endX = 11; u.ai_route_endY = 5; List<Graph> neigh; int index; int i; boolean finish = false; Graph current; int cost; Graph start = new Graph(u.xMap, u.yMap, 0, ManhattanDistance(u.xMap, u.yMap, u.ai_route_endX, u.ai_route_endY)); open.add(start); current = start; while(!finish) { index = findLowerF(); current = new Graph(open, index); System.out.println(current.x); System.out.println(current.y); if (current.x == u.ai_route_endX && current.y == u.ai_route_endY) { finish = true; } else { close.add(current); neigh = current.getNeighbors(); for (i = 0; i < neigh.size(); i++) { cost = current.g + ManhattanDistance(current.x, current.y, neigh.get(i).x, neigh.get(i).y); if (open.contains(neigh.get(i)) && cost < neigh.get(i).g) { open.remove(open.indexOf(neigh)); } else if (close.contains(neigh.get(i)) && cost < neigh.get(i).g) { close.remove(close.indexOf(neigh)); } else if (!open.contains(neigh.get(i)) && !close.contains(neigh.get(i))) { neigh.get(i).g = cost; neigh.get(i).f = cost + ManhattanDistance(neigh.get(i).x, neigh.get(i).y, u.ai_route_endX, u.ai_route_endY); neigh.get(i).setParent(current); open.add(neigh.get(i)); } } } } System.out.println("step"); for (i=0; i < close.size(); i++) { if (close.get(i).parent != null) { System.out.println(i); System.out.println(close.get(i).parent.x); System.out.println(close.get(i).parent.y); } } } private int findLowerF() { int i; int min = 10000; int minIndex = -1; for (i=0; i < open.size(); i++) { if (open.get(i).f < min) { min = open.get(i).f; minIndex = i; System.out.println("min"); System.out.println(min); } } return minIndex; } private int ManhattanDistance(int ax, int ay, int bx, int by) { return Math.abs(ax-bx) + Math.abs(ay-by); } And, as I've said. I suspect that the Graph class has the main problem. However I've not been able to detect and fix it. public class Graph { int x, y; int f,g,h; Graph parent; public Graph(int x, int y, int g, int h) { this.x = x; this.y = y; this.g = g; this.h = h; this.f = g + h; } public Graph(List<Graph> list, int index) { this.x = list.get(index).x; this.y = list.get(index).y; this.g = list.get(index).g; this.h = list.get(index).h; this.f = list.get(index).f; this.parent = list.get(index).parent; } public Graph(Graph gp) { this.x = gp.x; this.y = gp.y; this.g = gp.g; this.h = gp.h; this.f = gp.f; } public Graph(Graph gp, Graph parent) { this.x = gp.x; this.y = gp.y; this.g = gp.g; this.h = gp.h; this.f = g + h; this.parent = parent; } public List<Graph> getNeighbors() { List<Graph> aux = new ArrayList<Graph>(); aux.add(new Graph(x+1, y, g,h)); aux.add(new Graph(x-1, y, g,h)); aux.add(new Graph(x, y+1, g,h)); aux.add(new Graph(x, y-1, g,h)); return aux; } public void setParent(Graph g) { parent = g; } } Little Edit: Using the System.out and the Debugger I discovered that the program ALWAYS is check the same "current" graph, (15,8) which is the (u.xMap, u.yMap) position. Looks like it keeps forever in the first step.

    Read the article

  • Organizing Git repositories with common nested sub-modules

    - by André Caron
    I'm a big fan of Git sub-modules. I like to be able to track a dependency along with its version, so that you can roll-back to a previous version of your project and have the corresponding version of the dependency to build safely and cleanly. Moreover, it's easier to release our libraries as open source projects as the history for libraries is separate from that of the applications that depend on them (and which are not going to be open sourced). I'm setting up workflow for multiple projects at work, and I was wondering how it would be if we took this approach a bit of an extreme instead of having a single monolithic project. I quickly realized there is a potential can of worms in really using sub-modules. Supposing a pair of applications: studio and player, and dependent libraries core, graph and network, where dependencies are as follows: core is standalone graph depends on core (sub-module at ./libs/core) network depdends on core (sub-module at ./libs/core) studio depends on graph and network (sub-modules at ./libs/graph and ./libs/network) player depends on graph and network (sub-modules at ./libs/graph and ./libs/network) Suppose that we're using CMake and that each of these projects has unit tests and all the works. Each project (including studio and player) must be able to be compiled standalone to perform code metrics, unit testing, etc. The thing is, a recursive git submodule fetch, then you get the following directory structure: studio/ studio/libs/ (sub-module depth: 1) studio/libs/graph/ studio/libs/graph/libs/ (sub-module depth: 2) studio/libs/graph/libs/core/ studio/libs/network/ studio/libs/network/libs/ (sub-module depth: 2) studio/libs/network/libs/core/ Notice that core is cloned twice in the studio project. Aside from this wasting disk space, I have a build system problem because I'm building core twice and I potentially get two different versions of core. Question How do I organize sub-modules so that I get the versioned dependency and standalone build without getting multiple copies of common nested sub-modules? Possible solution If the the library dependency is somewhat of a suggestion (i.e. in a "known to work with version X" or "only version X is officially supported" fashion) and potential dependent applications or libraries are responsible for building with whatever version they like, then I could imagine the following scenario: Have the build system for graph and network tell them where to find core (e.g. via a compiler include path). Define two build targets, "standalone" and "dependency", where "standalone" is based on "dependency" and adds the include path to point to the local core sub-module. Introduce an extra dependency: studio on core. Then, studio builds core, sets the include path to its own copy of the core sub-module, then builds graph and network in "dependency" mode. The resulting folder structure looks like: studio/ studio/libs/ (sub-module depth: 1) studio/libs/core/ studio/libs/graph/ studio/libs/graph/libs/ (empty folder, sub-modules not fetched) studio/libs/network/ studio/libs/network/libs/ (empty folder, sub-modules not fetched) However, this requires some build system magic (I'm pretty confident this can be done with CMake) and a bit of manual work on the part of version updates (updating graph might also require updating core and network to get a compatible version of core in all projects). Any thoughts on this?

    Read the article

  • Graph Theory: How to compute closeness centrality for each node in a set of data?

    - by Jordan
    I'd like to learn how to apply network theory to my own cache of relational data. I'm trying to build a demo of a new way of browsing a music library, using network theory, that I think would make for a very intuitive and useful way of finding the right song at any given time. I have all the data (artists as nodes, similarity from 0 to 1 between each artist and those it is related to) and I can already program, but I don't know how to actually calculate the centrality of a node from that. I've spent a while trying to email different professors at my school but no one seems to know where I can learn this. I hope someone's done something similar. Thanks in advance you guys! ~Jordan

    Read the article

  • Cannot get a session with Facebook app? (using its Graph API)

    - by Jian Lin
    I have really simple few lines of Facebook app, using the new Facebook API: <pre> <?php require 'facebook.php'; // Create our Application instance. $facebook = new Facebook(array( 'appId' => '117676584930569', 'secret' => '**********', // hidden here on the post... 'cookie' => true, )); var_dump($facebook); ?> but it is giving me the following output: http://apps.facebook.com/woolaladev/i2.php would give out object(Facebook)#1 (6) { ["appId:protected"]=> string(15) "117676584930569" ["apiSecret:protected"]=> string(32) "**********" <--- just hidden on this post ["session:protected"]=> NULL <--- Session is NULL for some reason ["sessionLoaded:protected"]=> bool(false) ["cookieSupport:protected"]=> bool(true) ["baseDomain:protected"]=> string(0) "" } Session is NULL for some reason, but I am logged in and can access my home and profile and run other apps on Facebook (to see that I am logged on). I am following the sample on: http://github.com/facebook/php-sdk/blob/master/examples/example.php http://github.com/facebook/php-sdk/blob/master/src/facebook.php (download using raw URL: wget http://github.com/facebook/php-sdk/raw/master/src/facebook.php ) Trying on both hosting companies at dreamhost.com and netfirms.com, and the results are the same.

    Read the article

  • GRAPH PROBLEM: find an algorithm to determine the shortest path from one point to another in a recta

    - by newba
    I'm getting such an headache trying to elaborate an appropriate algorithm to go from a START position to a EXIT position in a maze. For what is worth, the maze is rectangular, maxsize 500x500 and, in theory, is resolvable by DFS with some branch and bound techniques ... 10 3 4 7 6 3 3 1 2 2 1 0 2 2 2 4 2 2 5 2 2 1 3 0 2 2 2 2 1 3 3 4 2 3 4 4 3 1 1 3 1 2 2 4 2 2 1 Output: 5 1 4 2 Explanation: Our agent looses energy every time he gives a step and he can only move UP, DOWN, LEFT and RIGHT. Also, if the agent arrives with a remaining energy of zero or less, he dies, so we print something like "Impossible". So, in the input 10 is the initial agent's energy, 3 4 is the START position (i.e. column 3, line 4) and we have a maze 7x6. Think this as a kind of labyrinth, in which I want to find the exit that gives the agent a better remaining energy (shortest path). In case there are paths which lead to the same remaining energy, we choose the one which has the small number of steps, of course. I need to know if a DFS to a maze 500x500 in the worst case is feasible with these limitations and how to do it, storing the remaining energy in each step and the number of steps taken so far. The output means the agent arrived with remaining energy= 5 to the exit pos 1 4 in 2 steps. If we look carefully, in this maze it's also possible to exit at pos 3 1 (column 3, row 1) with the same energy but with 3 steps, so we choose the better one. With these in mind, can someone help me some code or pseudo-code? I have troubles working this around with a 2D array and how to store the remaining energy, the path (or number of steps taken)....

    Read the article

  • How to find minimum cut-sets for several subgraphs of a graph of degrees 2 to 4

    - by Tore
    I have a problem, Im trying to make A* searches through a grid based game like pacman or sokoban, but i need to find "enclosures". What do i mean by enclosures? subgraphs with as few cut edges as possible given a maximum size and minimum size for number of vertices that act as soft constraints. Alternatively you could say i am looking to find bridges between subgraphs, but its generally the same problem. Given a game that looks like this, what i want to do is find enclosures so that i can properly find entrances to them and thus get a good heuristic for reaching vertices inside these enclosures. So what i want is to find these colored regions on any given map. The reason for me bothering to do this and not just staying content with the performance of a simple manhattan distance heuristic is that an enclosure heuristic can give more optimal results and i would not have to actually do the A* to get some proper distance calculations and also for later adding competitive blocking of opponents within these enclosures when playing sokoban type games. Also the enclosure heuristic can be used for a minimax approach to finding goal vertices more properly. Do you know of a good algorithm for solving this problem or have any suggestions in things i should explore?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >