Search Results

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

Page 17/154 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Scene graphs and spatial partitioning structures: What do you really need?

    - by tapirath
    I've been fiddling with 2D games for awhile and I'm trying to go into 3D game development. I thought I should get my basics right first. From what I read scene graphs hold your game objects/entities and their relation to each other like 'a tire' would be the child of 'a vehicle'. It's mainly used for frustum/occlusion culling and minimizing the collision checks between the objects. Spatial partitioning structures on the other hand are used to divide a big game object (like the map) to smaller parts so that you can gain performance by only drawing the relevant polygons and again minimizing the collision checks to those polygons only. Also a spatial partitioning data structure can be used as a node in a scene graph. But... I've been reading about both subjects and I've seen a lot of "scene graphs are useless" and "BSP performance gain is irrelevant with modern hardware" kind of articles. Also some of the game engines I've checked like gameplay3d and jmonkeyengine are only using a scene graph (That also may be because they don't want to limit the developers). Whereas games like Quake and Half-Life only use spatial partitioning. I'm aware that the usage of these structures very much depend on the type of the game you're developing so for the sake of clarity let's assume the game is a FPS like Counter-Strike with some better outdoor environment capabilities (like a terrain). The obvious question is which one is needed and why (considering the modern hardware capabilities). Thank you.

    Read the article

  • Triangulating a partially triangulated mesh (2D)

    - by teodron
    Referring to the above exhibits, this is the scenario I am working with: starting with a planar graph (in my case, a 2D mesh) with a given triangulation, based on a certain criterion, the graph nodes are labeled as RED and BLACK. (A) a subgraph containing all the RED nodes (with edges between only the directly connected neighbours) is formed (note: although this figure shows a tree forming, it may well happen that the subgraph contain loops) (B) Problem: I need to quickly build a triangulation around the subgraph (e.g. as shown in figure C), but under the constraint that I have to keep the already present edges in the final result. Question: Is there a fast way of achieving this given a partially triangulated mesh? Ideally, the complexity should be in the O(n) class. Some side-remarks: it would be nice for the triangulation algorithm to take into account a certain vertex priority when adding edges (e.g. it should always try to build a "1-ring" structure around the most important nodes first - I can implement iteratively such a routine, but it's O(n^2) ). it would also be nice to reflect somehow the "hop distance" when adding edges: add edges first between the nodes that were "closer" to each other given the start topology. Nevertheless, disregarding the remarks, is there an already known scenario similar to this one where a triangulation is built upon a partially given set of triangles/edges?

    Read the article

  • Graphical Interface and Object Selection/Manipulation

    - by ToriArendt
    I have a project I want to try to implement, but I'm kind of stuck on how to get started. I know there are probably a lot of resources that I can look at, but I'm really just stuck on what to even search for and where to begin. Basically, I have a program written in Java that separates 3D coordinates from a 3D reconstructed model into different objects. I then want to be able to perform a logistic regression on these objects to determine if they are type A or type B. But first, I need to classify a training set of objects as type A or B by hand. I don't know ANYTHING about graphing or user interfaces in Java, so I have been plotting the coordinates of a given object in MATLAB so that I can visualize the object and assign it a type. Now, as I am trying to make this program more "user friendly" I want to create an interface in Java where I can simply graph all the coordinates of the objects from the entire 3D model (on the same graph). I then want to be able to click on the each object and assign it to be either of type A or type B. I hope this description makes sense and someone can point me in the direction of something that will help me. I'm sorry if some of this terminology is off; I'm a bit new to software development. P.S. If anyone also has some tips on implementing logistic regression in Java, I'm sure I'll need them down the road :).

    Read the article

  • How can I display the users profile pic using the facebook graph api?

    - by kielie
    Hi, I would like to display the users profile picture inside of my applications canvas page, is there a way to do that using the graph api? I know I can do it using FBML but I would also like to pass the profile pic to a flash game I am making, so I would have to get the profile pic from the api and send it as a variable, here is the code I have thus far, $facebook = new Facebook(array( 'appId' => FACEBOOK_APP_ID, 'secret' => FACEBOOK_SECRET_KEY, 'cookie' => true, 'domain' => 'myurl/facebook-test' )); $session = $facebook->getSession(); $uid = $facebook->getUser(); $me = $facebook->api('/me'); $updated = date("l, F j, Y", strtotime($me['updated_time'])); echo "Hello " . $me['name'] . $me['picture'] . "<br />"; echo "<div style=\"background:url(images/bg.jpg); width:760px; height:630px;\">" . "You last updated your profile on " . $updated . "</div>" . "<br /> your uid is" . $uid; Thanx in advance!

    Read the article

  • How is this algorithm, for finding maximum path on a Directed Acyclical Graph, called?

    - by Martín Fixman
    Since some time, I'm using an algorithm that runs in complexity O(V + E) for finding maximum path on a Directed Acyclical Graph from point A to point B, that consists on doing a flood fill to find what nodes are accessible from note A, and how many "parents" (edges that come from other nodes) each node has. Then, I do a BFS but only "activating" a node when I already had used all its "parents". queue <int> a int paths[] ; //Number of paths that go to note i int edge[][] ; //Edges of a int mpath[] ; //max path from 0 to i (without counting the weight of i) int weight[] ; //weight of each node mpath[0] = 0 a.push(0) while not empty(a) for i in edge[a] paths[i] += 1 a.push(i) while not empty(a) for i in children[a] mpath[i] = max(mpath[i], mpath[a] + weight[a]) ; paths[i] -= 1 ; if path[i] = 0 a.push(i) ; Is there any special name for this algorithm? I told it to an Informatics professor, he just called it "Maximum Path on a DAG", but it doesn't sound good when you say "I solved the first problem with a Fenwick Tree, the second with Dijkstra, and the third with Maximum Path".

    Read the article

  • Common and useful Graph functions?

    - by Nazgulled
    Hi, I'm implementing a simple Graph library for my uni project and since this is the first time I'm dealing with graphs, I would like to know which functions you guys consider to be most common and useful for Graph implementations... So far, I have this: graphInitialize() graphInsertVertex() graphRemoveVertex() graphGetVertex() graphGetVertexValue() (not implemented yet, not sure if I'll need it) graphInsertEdge() graphRemoveEdge() graphLinkVertices() (this calls graphInsertEdge twice for bidirectional graph) graphUnlinkVertices() (this calls graphRemoveEdge twice for bidirectional graph) graphDestroy() I know I'm missing a function do determine the shortest path, but I'm leaving that for last... Do you think I'm missing any common/useful function?

    Read the article

  • 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

  • Functional testing in the verification

    - by user970696
    Yesterday my question How come verification does not include actual testing? created a lot of controversy, yet did not reveal the answer for related and very important question: does black box functional testing done by testers belong to verification or validation? ISO 12207:12208 here mentiones testing explicitly only as a validation activity, however, it speaks about validation of requirements of the intended use. For me its more high level, like UAT test cases written by business users ISO mentioned above does not mention any specific verification (7.2.4.3.2)except for Requirement verification, Design verification, Document and Code & Integration verification. The last two can be probably thought as unit and integrated testing. But where is then the regular testing done by testers at the end of the phase? The book I mentioned in the original question mentiones that verification is done by static techniques, yet on the V model graph it describes System testing against high level description as a verification, mentioning it includes all kinds of testing like functional, load etc. In the IEEE standard for V&V, you can read this: Even though the tests and evaluations are not part of the V&V processes, the techniques described in this standard may be useful in performing them. So that is different than in ISO, where validation mentiones testing as the activity. Not to mention a lot of contradicting information on the net. I would really appreciate a reference to e.g. a standard in the answer or explanation of what I missed in the ISO. For me, I am unable to tell where the testers work belong.

    Read the article

  • Array Multiplication and Division

    - by Narfanator
    I came across a question that (eventually) landed me wondering about array arithmetic. I'm thinking specifically in Ruby, but I think the concepts are language independent. So, addition and subtraction are defined, in Ruby, as such: [1,6,8,3,6] + [5,6,7] == [1,6,8,3,6,5,6,7] # All the elements of the first, then all the elements of the second [1,6,8,3,6] - [5,6,7] == [1,8,3] # From the first, remove anything found in the second and array * scalar is defined: [1,2,3] * 2 == [1,2,3,1,2,3] But What, conceptually, should the following be? None of these are (as far as I can find) defined: Array x Array: [1,2,3] * [1,2,3] #=> ? Array / Scalar: [1,2,3,4,5] / 2 #=> ? Array / Scalar: [1,2,3,4,5] % 2 #=> ? Array / Array: [1,2,3,4,5] / [1,2] #=> ? Array / Array: [1,2,3,4,5] % [1,2] #=> ? I've found some mathematical descriptions of these operations for set theory, but I couldn't really follow them, and sets don't have duplicates (arrays do). Edit: Note, I do not mean vector (matrix) arithmetic, which is completely defined. Edit2: If this is the wrong stack exchange, tell me which is the right one and I'll move it. Edit 3: Add mod operators to the list. Edit 4: I figure array / scalar is derivable from array * scalar: a * b = c => a = b / c [1,2,3] * 3 = [1,2,3]+[1,2,3]+[1,2,3] = [1,2,3,1,2,3,1,2,3] => [1,2,3] = [1,2,3,1,2,3,1,2,3] / 3 Which, given that programmer's division ignore the remained and has modulus: [1,2,3,4,5] / 2 = [[1,2], [3,4]] [1,2,3,4,5] % 2 = [5] Except that these are pretty clearly non-reversible operations (not that modulus ever is), which is non-ideal. Edit: I asked a question over on Math that led me to Multisets. I think maybe extensible arrays are "multisets", but I'm not sure yet.

    Read the article

  • Java NIO (Netty): How does Encryption or GZIPping work in theory (with filters)

    - by Tom
    Hello Experts, i would be very thankfull if you can explain to me, how in theory the "Interceptor/Filter" Pattern in ByteStreams (over Sockets/Channels) work (in Asynchronous IO with netty) in regard to encryption or compression of data. Given I have a Filter that does GZIPPING. How is this internally implemented? Does the Filter "collect" so many bytes form the channel, that this is a usefull number of bytes that can then be en/decoded? What is in general the minimal "blocksize(data to encode/decode in a chunk)" of socket based gzipping? Does this "blocksize" have to be negotiated in advance between server and client? What happens if the client does not send enough data to "fill" the blocksize (due to a network conquestion) but does not close the connection. Does this mean the other side will simply wait until it gets enough bytes to decode or until a timeout occoures...How is the Filter pattern the applied? The compression filter will de/compress the blocksize of bytes and then store them again in the same buffer would (in the case of netty) i normally be using the ChannelHanlderContext to pass the de/encoded data to the next filter?... Any explanations/links/tutorials (for beginners;-) will be very much appreciated to help me understand how for example encryption/compressing are implemented in socket based communication with filters/interceptor pattern. thank you very much tom

    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

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