#adjacency matrix representation of graph in data structure
Explore tagged Tumblr posts
emilyratajkowski164395 · 7 months ago
Text
Tumblr media
In network science, embedding refers to the process of transforming nodes, edges, or entire network structures into a lower-dimensional space while preserving the network's essential relationships and properties. Network embeddings are particularly valuable for machine learning applications, as they allow complex, non-Euclidean data (like a social network) to be represented in a structured, high-dimensional vector format that algorithms can process.
Building on the concept of embeddings in network science, these transformations unlock several advanced applications by enabling traditional machine learning and deep learning methods to operate effectively on graph data. A key advantage of embeddings is their ability to encode structural and relational information about nodes in a network into compact, dense vectors. This allows complex, sparse graphs to be represented in a way that preserves both local connections (like close friendships) and global structure (like communities within the network).
There are multiple approaches to generating these embeddings, each with its own strengths:
Random Walk-based Methods: Techniques like DeepWalk and node2vec use random walks to capture the network’s context for each node, similar to how word embeddings like Word2Vec capture word context. By simulating paths along the graph, these methods learn node representations that reflect both immediate neighbors and broader network structure.
Graph Neural Networks (GNNs): Graph neural networks, including variants like Graph Convolutional Networks (GCNs) and Graph Attention Networks (GATs), use neural architectures designed specifically for graph data. GNNs aggregate information from neighboring nodes, creating embeddings that adaptively capture the influence of each node’s surroundings. This is especially useful in tasks that require understanding both individual and community-level behavior, such as fraud detection or personalized recommendations.
Matrix Factorization Techniques: These methods, like LINE (Large-scale Information Network Embedding), decompose the graph adjacency matrix to find latent factors that explain connections within the network. Matrix factorization can be effective for representing highly interconnected networks, such as knowledge graphs, where the relationships between entities are intricate and abundant.
Higher-order Proximity Preserving Methods: Techniques like HOPE (High-Order Proximity preserved Embeddings) go beyond immediate neighbors, capturing higher-order structural relationships in the network. This approach helps model long-distance relationships, like discovering latent social or biological connections.
Temporal Network Embeddings: When networks evolve over time (e.g., dynamic social interactions or real-time communication networks), temporal embeddings capture changes by learning patterns across network snapshots, allowing predictive tasks on network evolution, like forecasting emerging connections or trends.
Network embeddings are powerful across disciplines. In financial networks, embeddings can model transaction patterns to detect anomalies indicative of fraud. In transportation networks, embeddings facilitate route optimization and traffic prediction. In academic and citation networks, embeddings reveal hidden relationships between research topics, leading to novel insights. Moreover, with visualization tools, embeddings make it possible to explore vast networks, highlighting community structures, influential nodes, and paths of information flow, ultimately transforming how we analyze complex interconnections across fields.
0 notes
codezclub · 8 years ago
Text
Write a C Program for Creation of Adjacency Matrix
Creation of Adjacency Matrix Write a C Program for Creation of Adjacency Matrix. Here’s simple Program for adjacency matrix representation of graph in data structure in C Programming Language. Adjacency Matrix:  Adjacency Matrix is a 2D array of size V x V where V is the number of vertices in a graph. Let the 2D array be adj[][], a slot adj[i][j] = 1 indicates that there is an edge from vertex i…
View On WordPress
0 notes
kitwallace · 3 years ago
Text
Finding Eulerian circuits
As discussed previously, Eulerian circuits are useful in 3D printing because they enable continuous extrusion which increases the strength of the printed object . In addition the lack of a seam improves its visual appearance.  
However finding a Eulerian circuit in a design is not always easy, and finding the ‘best’ even harder.
For a rectangular grid  (3 x 2) 
Tumblr media
a braiding program I developed a while ago finds a circuit.  It attempts to find a braid on an N x M grid.  If N and M are relatively prime, one rope (ie. a Eulerian circuit) completes the grid  but if not (like this 6 x 3), multiple ropes are needed.
Tumblr media
This restriction on the size of this mesh is not helpful.  Since every N x M mesh of this style is Eulerian, they must all have a Eulerian circuit. This could  be constructed if we were able to join up the separate partial loops. Start somewhere and follow a chain of unvisited edges until you get back to the start.  If all edges have been visited, you are done. If not, go back to the last vertex with unvisited edges and start a new circuit at that point, with those points inserted into the current circuit .This is the Hierholzer algorithm.
Hierholzer algorithm
I searched for a pseudo code implementation but wasn’t satisfied with any that I found.  Any implementation depends heavily on the data structures used: for the graph itself in a form in which edges can be removed as they are visited and for the path as it is constructed, adding a vertex to the end and rotating the path to backtrack. 
One representation of a graph with V vertices and E edges is as a V x V adjacency matrix where adj[i,j] =1 indicates the edge i to j which will be symmetric across the diagonal if the graph (as here) is undirected.  Updating is straightforward but  navigating from vertex to vertex requires a scan through a row.  
Alternatively, the graph can be represented as an array of lists of the connected vertices  - easy to navigate, more compact for a sparse graph (as these are)  but harder to update.  
The JavaScript array structure can implement the vertex list and the evolving path. I found this is a useful summary of operators. push() and pop()  will add and remove the head of the list;�� unshift() and shift() do the same at the tail of the list.  myArray[myArray.length - 1] and myArray[0] return the head and tail of the list respectively.
Minimizing turns in the circuit
The Hierholzer algorithm mechanically selects the next vertex by taking any vertex (the first or the last perhaps) from the list of possible vertices. This does find a circuit but not necessarily a good circuit.  For the purposes of 3D printing, good means a circuit with a minimum number of turns since straight runs will be stronger and faster.  To get a good, though not necessarily the best, circuit, I added a kind code to each edge and then choose a vertex in the same kind if possible.  For the rectangular mesh above, there are two kinds , coded +1 for the right diagonal, -1 for the left.  (note that we don’t need to distinguish between the direction of travel on a diagonal since we can’t reverse direction at a vertex as that edge has just been traversed)
JavaScript Implementation
In the Fottery suite, the algorithm is implemented as a method in a Graph class which includes the adjacency structure adj and supporting functions:
find_circuit(kind-0,start_vertex = 0 ) {    // assumes graph is connected and a euler circuit exists         var cpath =[];        var vertex, next_vertex, edge, edges;        cpath.push(start_vertex);        while (cpath.length < this.n_edges  ) {            vertex = cpath[cpath.length - 1];  // the last vertex in the constructed path            edges = this.adj[vertex];  // get its  adjacent nodes (untraversed edges)            if (edges.length == 0) {  // if no untraversed edges                cpath.pop();   // rotate back to the previous vertex                if (!(vertex == initial_vertex && cpath[0]==vertex)) { // dont  include the start at the end                  cpath.unshift(vertex);                 }            } else {                  edge = this.best_edge(edges,kind);                  next_vertex= edge[0];                kind = edge[1];                cpath.push(next_vertex);  // add  vertex to the path                this.remove_edge(vertex,next_vertex); // remove the traversed edge            }         }
       // get start back to the first in the path        while (cpath[0] != start_vertex)                  cpath.push(cpath.shift());        return cpath;
[damn discovered a use-case where this implementation fails!   
16 April 2024 - fixed edge case with the bold change ] 
Example
A  rectangular N x M  mesh like the one above is more useful if the vertices at the edges are connected to make a border.  This addition does not change the Eulerian nature of the graph, but introduces two more directions, horizonal and vertical.  This is the resultant 2 x 3 mesh.
Tumblr media
and this a box constructed from rectangular meshes.  The sides are bevelled by insetting the top layer from the bottom by the thickness of the tile to make a 45 degree bevel.  Assembled with plastic glue (UHU).
Tumblr media
Stars (stellated polygons)
This algorithm has been applied to other structures such as a triangular mesh and stars.   
A pentagram can be constructed with 5 vertices and 5 edges connecting pairs of vertices.This is a closed path so Eulerian.
Tumblr media
A hexagram looks Eulerian, but if constructed by connecting the vertices of the star, the graph is not connected (two separate triangular paths).
Tumblr media
To make a circuit so it can be printed continuously, we have to compute the 6 intersections and the 18 edges (of 3 kinds)  which result from the intersections, and then use the modified Hierholzer algorithm to find a good circuit.  
A fully connected star is only Eulerian if the number of vertices is odd - which makes for a kind of infill pattern.
Tumblr media
Nearly Eulerian graphs
Structures which are Eulerian are rather limited. An hexagonal tiling is not Eulerian because vertices are order 3. However it and many others are nearly Eulerian in the sense that small modifications to the graph will make the graph Eulerian. The basic idea is to duplicate ( the minimum number of ) edges. If this is a problem with printing, the edge could be omitted or an additional edge inserted.
This problem  is called the Chinese Postman Problem or Route Inspection Problem and the subject of extensive research. 
This is work for another day -.April 2024 see Non-Eulerian graphs
References
Fleischner, Herbert (1991), "X.1 Algorithms for Eulerian Trails”   https://archive.org/details/euleriangraphsre0001flei/page/
Gregory Dreifus,Kyle Goodrick,Scott Giles,Milan Patel Path Optimization Along Lattices in Additive Manufacturing Using the Chinese Postman Problem June 2017  https://www.researchgate.net/publication/317701126_Path_Optimization_Along_Lattices_in_Additive_Manufacturing_Using_the_Chinese_Postman_Problem
Prashant Gupta, Bala Krishnamoorthy, Gregory Dreifus  Continuous Toolpath Planning in a Graphical Framework for Sparse Infill Additive Manufacturing  April 2021 https://arxiv.org/pdf/1908.07452.pdf
https://algorithms.discrete.ma.tum.de/graph-algorithms/directed-chinese-postman/index_en.html
https://www.stem.org.uk/resources/elibrary/resource/31128/chinese-postman-problems
https://ibmathsresources.com/2014/11/28/the-chinese-postman-problem/
http://www.suffolkmaths.co.uk/pages/Maths%20Projects/Projects/Topology%20and%20Graph%20Theory/Chinese%20Postman%20Problem.pdf
1 note · View note
webtechschool · 5 years ago
Text
Tumblr media
Graph Representation | Adjacency List | Adjacency Matrix | Data Structures & Algorithms
https://bit.ly/GraphRepresentation
0 notes
meetcoogle · 6 years ago
Link
Google Play: http://tinyurl.com/y5gwyt7v  This book is useful for IGNOU BCA & MCA students. A perusal of past questions papers gives an idea of the type of questions asked, the paper pattern and so on, it is for this benefit, we provide these IGNOU MCS-021-Data and File Structures Notes. Students are advised to refer these solutions in conjunction with their reference books. It will help you to improve your exam preparations.  This book covers Basic data structures such as arrays, stack and queues and their applications, linked and sequential representation. Linked list, representation of linked list, multi linked structures. Trees: definitions and basic concepts, linked tree representation, representations in contiguous storage, binary trees, binary tree traversal, searching insertion and deletion in binary trees, heap tree and heap sort algorithm, AVL trees.  Graphs and their application, sequential and linked representation of graph – adjacency matrix, operations on graph, traversing a graph, Dijkstra’s algorithm for shortest distance, DFS and BFS, Hashing. Searching and sorting, use of various data structures for searching and sorting, Linear and Binary search, Insertion sort, Selection sort, Merge sort, Radix sort, Bubble sort, Quick sort, Heap Sort.  Published by MeetCoogle #MeetCoogle #erotica #romance #bdsm #bookish #booksforchildren #readingisfun #writersofinstagram #love #booksforkids #kidsbook #instabook #christian #jesus #childrenreading #whatyouneed #needtoread #needtolisten #talesforchildren #bookclub #read #kindlebooks #booksofinstagram #jesuschrist #digitallearning #freebooks #authorsofinstagram #entrepreneurmindset #bookrecommendation #authors #deborahhbateman #biblestudy #writers #dailybiblereading
0 notes
felord · 5 years ago
Text
CS251 : Data Structures Project #07: Part 1 and 2:  updated graph class Solved
CS251 : Data Structures Project #07: Part 1 and 2:  updated graph class Solved
 Assignment
We’ve been working with a graphclass limited to at most 100 vertices.  This limitation is due to the underlying implementation based on an adjacency matrix.  Your assignment here in part 1 is to remove this limitation by rewriting the graph class to use an adjacency list representation.  The “list” does not have to be a linked-list, you are free to use whatever data structure you want…
View On WordPress
0 notes
zipgrowth · 7 years ago
Text
Helping Students See Hamlet and Harry Potter in a New Light With Computational Thinking
Like many kids of my generation growing up in India, I was an avid reader of Enid Blyton’s novels. Many of her books were written as a series (“The Famous Five,” “The Secret Seven” and “Five Find-Outers”) and I recall wondering if the lives of characters overlapped in any way. Did a character from one series ever run into one from another, for example? I recall wondering the same thing in later years about P.G. Wodehouse’s Blandings Castle and Jeeves series.
Today, in a world where communities real and imagined are digitally connected via platforms like Facebook, Instagram and Tumblr, we can reframe that question in terms of those common nodes (or friends) in those characters’ social networks.
As it turns out, network theory as an analytic technique, or what I’d call computational literary analysis, is not just a bona fide research endeavor. It’s also a great example of how computational thinking (CT) is truly a cross-disciplinary skill that can be weaved to enrich learning in any subject (not just math and science, as is sometimes the assumption). In an earlier article on computational thinking, I offered teasers of how CT could be integrated into language arts and social studies, in addition to math and science.
Here’s a detailed treatment of one of those examples, drawn from the work of Franco Moretti’s group on “Computational Criticism,” which is part of the broader Digital Humanities initiative at Stanford. (See this New York Times profile for more on the work of this group).
I first became aware of Moretti’s work in a Boston Globe article provocatively titled, “Hamlet and the Region of Death.” It led me to his fascinating “Network Theory Plot Analysis” in which he describes the use of social graphs to analyze Shakespeare’s popular tragedy.
This kind of literary analysis basically involves analyzing “network diagrams” or “interaction graphs,” where characters are represented as nodes and two characters are joined by an edge if they have interacted through dialogue. Such a representation of a novel can facilitate a unique look at stories (even though such a representation loses the temporal dimension in stories). As the article observes:
“Seen through Moretti’s network diagrams, ‘Hamlet’ often seems brand new. One notices, for example, that of all the characters who speak to both Hamlet and Claudius, only two manage to survive the play (Moretti calls this part of the network the “region of death”). The tragedy he wrote is all there in that graph. Or one notices that Rosencrantz and Guildenstern, the most famous pair of minor characters in all of Shakespeare, never speak to each other.”
Moretti’s research paper on this work also describes a network of Hamlet without Hamlet. How absolutely fascinating it would to analyze relationships in a play without the lead character in the picture!
Image credit: Shuchi Grover
This technique provides not only a new analytic lens into a literary work, but also helps students experience the value of abstractions or representations such as graphs, and the organization of information into a discrete data structure. If we wanted to take a deeper computer-science approach and make computational thinking connections with this literary activity, students could transform the graph in Figure 1 below to a 2-dimensional data structure, or “adjacency matrix” by marking edges between nodes with a check mark (Figure 2).
Image credit: Shuchi Grover
And if we replaced ✓’s by 1’s (Figure 3 below), the adjacency matrix could then be represented as a 2D array data structure in a program, thus allowing the social graph to then be analyzed computationally. Once students have created this 2D matrix representation of a social graph, a row/column total easily provides the number of connections associated with each character (node).
More importantly, though, they’ve taken a crucial step closer to automating analyses (or even just visualization) of the story. The 1’s could also be replaced by a value as a “weight” to represent the number of interactions. And with that extension, the analyses could be expanded to include a whole new set of questions related to the strength of relationships.
Image credit: Shuchi Grover
Using an appropriate representation or abstraction for problem-solving is a crucial piece of computational thinking. Just as algorithms written in psuedo-code or flowcharts help learners make the step from problem to program, so do appropriate data structures. One of the most influential early programming textbooks (by Niklaus Wirth, the creator of the Pascal programming language) underscoring the intertwined nature of algorithms and data structures was famously titled “Algorithms + Data Structures = Programs.” In a similar vein, another computer scientist, David Jones, famously wrote, “Get your data structures correct first, and the rest of the program will write itself.”
And why stop at Shakespeare and Hamlet when you could engage kids in a social network analysis of Harry Potter? What if we wanted to know who amongst Harry Potter’s two closest friends, Ron and Hermione, played the more significant role in the novels? As it turns out, some enthusiasts have coded an elaborate network, called “The Wizarding Network of Harry Potter,” to help answer questions such as these.
Screenshot of a relationship map from “The Wizarding Network of Harry Potter.”
Remember, computational thinking is about formulating approaches to problem solving so that the solutions can potentially be solved by a computer. Even if kids do not code such a network, understanding the types of questions that can be answered through such automated abstractions as “The Wizarding Network of Harry Potter” (or some version of it) is an important and useful aspect of understanding how automating the solution impacts the problem-solving process. This also includes understanding what kinds of data and analyses can be automated (and how), and which cannot.
Socially-conscious students in secondary grades may similarly consider analyzing representation of historically underrepresented groups in popular media. Creating interaction graphs of screenplays of films and analyzing characters and roles based on who they interact with would make for a cool CS or language arts project! (As a matter of fact, in recent years such analyses have actually helped to reveal tokenism in Hollywood when it comes to the roles of women and ethnic minorities in film.)
Creating a network graph abstraction, using it to analyze the relationships between characters in a story, transforming the graph into data structure representation (or vice versa), and asking the kinds of questions that can be answered through such abstract models, are all examples of how computational thinking can be valuable for literary analysis in a language arts classroom. Students can do much of this without coding, although taking that next step to code such an abstraction would make this experience even more powerful. Classes where students have experience with coding in programming languages that support 2D data structures should certainly give computational literary analysis a shot. Such a classroom could also discuss the limitations of manually creating graphs and adjacency matrices for lengthy novels, and how computing and natural language processing can automate that process.
Hopefully these ideas have triggered the imagination of not just language arts teachers, but their peers in the humanities and social sciences as well, who can all apply network theory to analyze a whole host of social and cultural phenomena.
Helping Students See Hamlet and Harry Potter in a New Light With Computational Thinking published first on https://medium.com/@GetNewDLBusiness
0 notes
naivelocus · 8 years ago
Text
Protein Sequence Comparison Based on Physicochemical Properties and the Position-Feature Energy Matrix
Zhao, Y., Li, X. & Qi, Z. Novel 2D graphic representation of protein sequence and its application. J. Fiber Bioengineering and Informatics 7, 23–33 (2014).
Huang, D. & Yu, H. Normalized Feature Vectors: A novel alignment-free sequence comparison method based on the numbers of adjacent amino acids. IEEE/ACM Trans. Comput. Biol. 10, 457–467 (2013).
Gotoh, O. An improved algorithm for matching biological sequences. J. Mol. Biol. 162, 705–708 (1982).
Chakraborty, A. & Bandyopadhyay, S. FOGSAA: Fast optimal global sequence alignment algorithm. Sci. Rep. 3, 1746 (2013).
Feng, D. & Doolittle, R. F. Progresssive sequence alignment as a prerequisite to correct phylogenetic trees. J. Mol. Evol. 25, 351–360 (1987).
Bradley, R. K. et al. Fast Statistical Alignment. PLoS Comput. Biol. 5, e1000392 (2009).
Reinert, G., Chew, D., Sun, F. & Waterman, M. S. Alignment-free sequence comparison(I): Statistics and power. J. Comput. Biol. 16, 1615–1634 (2009).
Schwende, I. & Pham, T. D. Pattern recognition and probabilistic measures in alignment-free sequence analysis. Brief Bioinform 15, 354–368 (2014).
Borozan, I., Watt, S. & Ferretti, V. Integrating alignment-based and alignment-free sequence similarity measures for biological sequence classification. Bioinf. 31, 1396–1404 (2015).
Didier, G., Corel, E., Laprevotte, I., Grossmann, A. & Landès-Devauchelle, C. Variable length local decoding and alignment-free sequence comparison. Theor. Comput. Sci. 462, 1–11 (2012).
Nakashima, H., Nishikawa, K. & Ooi, T. The folding type of a protein is relevant to the amino acid composition. J. Biochem. 99, 152–162 (1986).
Chou, K. C. Some remarks on protein attribute prediction and pseudo amino acid composition (50th Anniversary Year Review). J. Theor. Biol. 273, 236–247 (2011).
Mohabatkar, H., Beigi, M. M., Abdolahi, K. & Mohsenzadeh, S. Prediction of allergenic proteins by means of the concept of Chou’s pseudo amino Aacid composition and a machine learning approach. Medicinal Chemistry 9, 133–137 (2013).
Zhong, W. & Zhou, S. Molecular science for drug development and biomedicine. Int. J. Molec. Sci. 15, 20072–20078 (2014).
He, P., Wei, J., Yao, Y. & Tie, Z. A novel graphical representation of proteins and its application. Physica A 391, 93–99 (2012).
Randić M. et al. Graphical representation of proteins. Chem. Rev. 111, 790–862 (2011).
Jiang, S., Liu, W. & Fee, C. H. Graph theory of enzyme kinetics: I. Steady state reaction system, Scientia Sinica 22, 341–358 (1979).
Yao, Y. et al. Analysis of similarity/dissimilarity of protein sequences. Proteins 73, 864–871 (2008).
Kuang, C., Liu, X., Wang, J., Yao, Y. & Dai, Q. Position-specific statistical model of DNA sequences and its application for similarity analysis. MATCH Commun. Math. Comput. Chem. 73, 545–558 (2015).
Sun, D., Xu, C. & Zhang, Y. A novel method of 2D graphical representation for proteins and its application. MATCH Commun. Math. Comput. Chem. 75, 431–446 (2016).
Xia, X. & Li, W. What amino acid properties affect protein evolution? J. Mol. Evol. 47, 557–564 (1998).
Qi, Z., Jin, M., Li, S. & Feng, J. A protein mapping method based on physicochemical properties and dimension reduction. Comput. Biol. Med. 57, 1–7 (2015).
Gutman, I. The energy of a graph. Ber. Math. Statist. Sekt. Forschungsz. Graz 103, 1–22 (1978).
Wu, H., Zhang, Y., Chen, W. & Mu, Z. Comparative analysis of protein primary sequences with graph energy. Physica A 43, 249–262 (2015).
Gutman, I., Li, X. & Zhang, J. Graph energy, in: Analysis of Complex Networks. From Biology to Linguistics, (ed. Dehmer, M. & Emmert-Streib, F.) 145–174 (Wiley-VCH, Weinheim, 2009).
Li, X., Shi, Y. & Gutman, I. Graph Energy (ed. Li, X., Shi, Y. & Gutman) (Springer. New York, 2012).
Zamyatin, A. A. Protein volume in solution. Prog. Biophys. Mol. Biol. 24, 107–123 (1972).
Chotia, C. The nature of the accessible and buried surfaces in proteins. J. Mol. Biol. 105, 1–14 (1975).
Randić, M. 2-D graphical representation of proteins based on physicochemical properties of amino acids. Chem. Phys. Lett. 444, 176–180 (2007).
Paola, L. D., Mei, G., Venere, A. D. & Giuliani, A. Exploring the stability of dimers through protein structure topology. Curr. Protein Peptide Sci. 17, 30–36 (2016).
Yu, L., Zhang, Y., Jian, G. & Gutman, I. Classification for microarray data based on K-means clustering combined with modified single-to-noise-ratio based on graph energy, J. Comput. Theor. Nanosci. 14, 598–606 (2017).
Emmert-Streib, F., Dehmer, M. & Shi, Y. Fifty years of graph matching, network alignment and comparison. Inform. Sci. 346–347, 180–197 (2016).
Dehmer, M., Emmert-Streib, F., Chen, Z., Li, X. & Shi, Y. Mathematical Foundations and Applications of Graph Entropy, (ed. Dehmer, M. et al.) (Wiley, 2016).
Yu, C., Deng, M. & Yau, S. S. DNA sequence comparison by a novel probabilistic method. Inf. Sci. 181, 1484–1492 (2011).
Cover, T. M. & Thomas, J. A. Elements of Informatiobn Theory, (ed. Wiley, J. & Sons) 2nd edition (Wiley, 1991).
Kullback, S. & Leibler, R. A. On information and sufficiency. Ann. Math. Stat. 22, 79–86 (2015).
Yu, C., Cheng, S., He, R. & Yau, S. S. Protein map: A alignment-free sequence comparison method based on various properties of amino acids. Gene 486, 110–118 (2011).
Emmert-Streib, F. & Dehmer, M. Information processing in the transcriptional regulatory network of yeast: Functional robustness. BMC Systems Biology 3 (2009).
Lam, W. & Bacchus, F. Learning Bayesian belief networks: An approach based on the MDL principle. Computat. Intell. 10, 269–293 (1994).
Xiao, X. et al. Using complexity measure factor to predict protein subcellular location. Amino Acids 28, 57–61 (2005).
Liao, B., Liao, B., Sun, X. & Zeng, Q. A novel method similarity analysis and protein sub-cellular localization prediction. Bioinf. 26, 2678–2683 (2010).
Mu, Z., Wu, J. & Zhang, Y. A novel method for similarity/dissimilarity analysis of protein sequences. Physica A 392, 6361–6366 (2013).
Chang, G. & Wang, T. Phylogenetic analysis of protein sequences based on distribution of length about common substring. Protein J. 30, 167–172 (2011).
Ford, M. J. Molecular evolution of transferrin: Evidence for positive selection in salmonids. Mol. Biol. Evol. 18, 639–647 (2001).
Davies, P. L., Baardsnes, J., Kuiper, M. J. & Walker, V. K. Structure and function of antifreeze proteins. Phil. Trans. R. Soc. Lond. B 357, 927–935 (2002).
Duman, J., Verleye, D. & Li, N. Site-specific forms of antifreeze protein in the beetle dendroides canadensis. J. Comp. Physiol. B 172, 547–552 (2002).
Graether, S. P. et al. Beta-helix structure and ice-binding properties of a hyperactive antifreeze protein from an insect. Nature 406, 325–328 (2000).
Graether, S. P. & Sykes, B. D. Cold survival in freeze intolerant insects: the structure and function of beta-helical antifreeze proteins. J. Biochem. 271, 3285–3296 (2004).
Altschul, S. F. et al. Gapped LAST and PSI-BLAST: a new generation of protein database search programs. Nucleic Acids Res. 25, 3389–3402 (1997).
Yau, S., Yu, C. & He, R. A protein map and its application. DNA Cell. Biol. 27, 241–250 (2008).
Xu, C., Sun, D., Liu, S. & Zhang, Y. Protein sequence analysis by incorporating modified chaos game and physicochemical properties into Chou’s general pseudo amino acid composition. J. Theor. Biol. 406, 105–115 (2016).
— Nature Scientific Reports
0 notes
meetcoogle · 6 years ago
Link
Google Play: http://tinyurl.com/y4dvfjda  This book is useful for IGNOU BCA & MCA students. A perusal of past questions papers gives an idea of the type of questions asked, the paper pattern and so on, it is for this benefit, we provide these IGNOU MCS-021-Data and File Structures Notes. Students are advised to refer these solutions in conjunction with their reference books. It will help you to improve your exam preparations.  This book covers Basic data structures such as arrays, stack and queues and their applications, linked and sequential representation. Linked list, representation of linked list, multi linked structures. Trees: definitions and basic concepts, linked tree representation, representations in contiguous storage, binary trees, binary tree traversal, searching insertion and deletion in binary trees, heap tree and heap sort algorithm, AVL trees.  Graphs and their application, sequential and linked representation of graph – adjacency matrix, operations on graph, traversing a graph, Dijkstra’s algorithm for shortest distance, DFS and BFS, Hashing. Searching and sorting, use of various data structures for searching and sorting, Linear and Binary search, Insertion sort, Selection sort, Merge sort, Radix sort, Bubble sort, Quick sort, Heap Sort.  Published by MeetCoogle #MeetCoogle #erotica #romance #bdsm #bookish #booksforchildren #readingisfun #writersofinstagram #love #booksforkids #kidsbook #instabook #christian #jesus #childrenreading #whatyouneed #needtoread #needtolisten #talesforchildren #bookclub #read #kindlebooks #booksofinstagram #jesuschrist #digitallearning #freebooks #authorsofinstagram #entrepreneurmindset #bookrecommendation #authors #deborahhbateman #biblestudy #writers #dailybiblereading
0 notes
meetcoogle · 6 years ago
Link
Google Play: http://tinyurl.com/y3wugxyn  This book is useful for IGNOU BCA & MCA students. A perusal of past questions papers gives an idea of the type of questions asked, the paper pattern and so on, it is for this benefit, we provide these IGNOU MCS-021-Data and File Structures Notes. Students are advised to refer these solutions in conjunction with their reference books. It will help you to improve your exam preparations.  This book covers Basic data structures such as arrays, stack and queues and their applications, linked and sequential representation. Linked list, representation of linked list, multi linked structures. Trees: definitions and basic concepts, linked tree representation, representations in contiguous storage, binary trees, binary tree traversal, searching insertion and deletion in binary trees, heap tree and heap sort algorithm, AVL trees.  Graphs and their application, sequential and linked representation of graph – adjacency matrix, operations on graph, traversing a graph, Dijkstra’s algorithm for shortest distance, DFS and BFS, Hashing. Searching and sorting, use of various data structures for searching and sorting, Linear and Binary search, Insertion sort, Selection sort, Merge sort, Radix sort, Bubble sort, Quick sort, Heap Sort.  Published by MeetCoogle #MeetCoogle #erotica #romance #bdsm #bookish #booksforchildren #readingisfun #writersofinstagram #love #booksforkids #kidsbook #instabook #christian #jesus #childrenreading #whatyouneed #needtoread #needtolisten #talesforchildren #bookclub #read #kindlebooks #booksofinstagram #jesuschrist #digitallearning #freebooks #authorsofinstagram #entrepreneurmindset #bookrecommendation #authors #deborahhbateman #biblestudy #writers #dailybiblereading
0 notes
meetcoogle · 6 years ago
Link
Google Play: http://tinyurl.com/y62vttsc  This book is useful for IGNOU BCA & MCA students. A perusal of past questions papers gives an idea of the type of questions asked, the paper pattern and so on, it is for this benefit, we provide these IGNOU MCS-021-Data and File Structures Notes. Students are advised to refer these solutions in conjunction with their reference books. It will help you to improve your exam preparations.  This book covers Basic data structures such as arrays, stack and queues and their applications, linked and sequential representation. Linked list, representation of linked list, multi linked structures. Trees: definitions and basic concepts, linked tree representation, representations in contiguous storage, binary trees, binary tree traversal, searching insertion and deletion in binary trees, heap tree and heap sort algorithm, AVL trees.  Graphs and their application, sequential and linked representation of graph – adjacency matrix, operations on graph, traversing a graph, Dijkstra’s algorithm for shortest distance, DFS and BFS, Hashing. Searching and sorting, use of various data structures for searching and sorting, Linear and Binary search, Insertion sort, Selection sort, Merge sort, Radix sort, Bubble sort, Quick sort, Heap Sort.  Published by MeetCoogle #MeetCoogle #erotica #romance #bdsm #bookish #booksforchildren #readingisfun #writersofinstagram #love #booksforkids #kidsbook #instabook #christian #jesus #childrenreading #whatyouneed #needtoread #needtolisten #talesforchildren #bookclub #read #kindlebooks #booksofinstagram #jesuschrist #digitallearning #freebooks #authorsofinstagram #entrepreneurmindset #bookrecommendation #authors #deborahhbateman #biblestudy #writers #dailybiblereading
0 notes
codezclub · 8 years ago
Text
C Program to find Path Matrix by powers of Adjacency matrix
Path Matrix by powers of Adjacency Matrix Write a C Program to find Path Matrix by powers of Adjacency Matrix. Here’s simple Program to find Path Matrix by powers of Adjacency Matrix in C Programming Language. Adjacency Matrix:  Adjacency Matrix is a 2D array of size V x V where V is the number of vertices in a graph. Let the 2D array be adj[][], a slot adj[i][j] = 1 indicates that there is an…
View On WordPress
0 notes
felord · 6 years ago
Text
FIT1045 Algorithms and programming in Python, S2 Assignment 1 Solved
Objectives
The objectives of this assignment are: To demonstrate the ability to implement algorithms using basic data structures and operations on them. To gain experience in designing an algorithm for a given problem description and implementing that algorithm in Python.
Submission Procedure
Save your files into a zip file called yourStudentID yourFirstName yourLastName.zip Submit your zip file containing your solution to Moodle. Your assignment will not be accepted unless it is a readable zip file. Important Note: Please ensure that you have read and understood the university’s policies on plagiarism and collusion available at http://www.monash.edu.au/students/policies/academic-integrity.html. You will be required to agree to these policies when you submit your assignment. A common mistake students make is to use Google to find solutions to the questions. Once you have seen a solution it is often difficult to come up with your own version. The best way to avoid making this mistake is to avoid using Google. You have been given all the tools you need in workshops. If you find you are stuck, feel free to ask for assistance on Moodle, ensuring that you do not post your code. Marks: This assignment will be marked both by the correctness of your code and by an interview with your lab demonstrator, to assess your understanding. This means that although the quality of your code (commenting, decomposition, good variable names etc.) will not be marked directly, it will help to write clean code so that it is easier for you to understand and explain. This assignment has a total of 12 marks and contributes to 10% of your final mark. For each day an assignment is late, the maximum achievable mark is reduced by 10% of the total. For example, if the assignment is late by 3 days (including weekends), the highest achievable mark is 70% of 12, which is 8.4. Assignments submitted 7 days after the due date will normally not be accepted. Detailed marking guides can be found at the end of each task. Marks are subtracted when you are unable to explain your code via a code walk-through in the assessment interview. Readable code is the basis of a convincing code walk-through.
Task 1: Strings (3.5 Marks)
Create a Python module called strings.py. Within this module implement the following three tasks. For this module you may not use the Python sequence method s.count(x). You may not import any other libraries or modules.
Part A: Code Breaker (1 Mark)
Write a function decode(string, n) that takes in an encoded message as a string and returns the decoded message. Input: a string string and a positive integer n. Output: the decoded string. The string is decoded by discarding the first n characters from the input string, keeping the next n characters, discarding the next n characters, and so on, until the input string is exhausted. There is no guarantee at which point in the decoding (keep or discard) the string will be exhausted. There is no guarantee that the length of string will be a multiple of n. Examples Calling decode(‘#P#y#t#h#o#n#’, 1) returns ‘Python’. Calling decode(‘AxYLet1x3’s T74codaa7e!’, 3) returns ‘Let’s code!’.
Part B: Pattern Finder (1 Mark)
Write a function pattern count(string, pat) that counts how many times a pattern occurs within a text. Input: a string string and a non-empty string pat, both comprising both upper and lower case alphanumeric and non-alphanumeric characters. Output: an integer count of the number of times pat occurs within string. The count is case sensitive. (See Example c.) Examples Calling pattern count(‘bcabcabca’, ‘abc’) returns 2. Calling pattern count(‘aaaa’, ‘aa’) returns 3. Calling pattern count(‘A long time ago in a galaxy far, far away...’, ‘a’) returns 8. Calling pattern count(‘If you must blink, do it now.’, ‘code’) returns 0.
Part C: Palindromes (1.5 Marks)
A palindrome is a word, phrase, or sequence that reads the same backwards as forwards. Write a function palindrome(string) that determines whether or not a given string is a palindrome. In order to receive full marks, the function must determine whether the alphanumerical characters create a palindrome (see Examples). Input: a string string comprising both upper and lower case alphanumeric and non-alphanumeric characters. Output: a boolean, True if the string when converted to lower case alphanumeric characters is a palindrome; otherwise False. Examples Calling palindrome(‘RacecaR’) returns True because ‘RacecaR’ reads the same backwards as forwards. Calling palindrome(‘66racecar77’) returns False because ‘66racecar77’ does not read the same backwards as forwards. Calling palindrome(‘Racecar’) returns True because ‘racecar’ reads the same backwards as forwards. Calling palindrome(‘Madam, I’m Adam’) returns True because ‘madamimadam’ reads the same backwards as forwards. Calling palindrome(‘#4Satire: Veritas4’) returns True because ‘4satireveritas4’ reads the same backwards as forwards.
Marking Guide (total 3.5 marks)
Marks are given for the correct behavior of the different functions: 1 mark for decode. 1 mark for pattern count. 5 marks if palindrome can correctly identify that a string with no processing is a palindrome (see Examples a and b), 1.5 marks if palindrome can correctly identify that a string when converted to lower case alphanumeric characters is a palindrome (see Examples c, d, and e).
Task 2: Friends (4.5 Marks)
You have been employed by Monash to analyse friendship groups on campus. Individuals have been allocated a number between 0 and the number of people on campus (minus one), and their friendships have been recorded as edges between numbered vertices. We assume friendships are always bi-directional. Monash has implemented this graph in a Python-readable format as both an adjacency matrix and an adjacency list. Create a Python module called friends.py. Within this module implement the following three tasks. Ensure you follow the inputs for each function correctly - one function takes an adjacency list, two functions take an adjacency matrix. You may not import any other libraries or modules.
Part A: Popular (1.5 Marks)
Write a function popular(graph list, n) that returns a list of people who have at least n friends. Each person is identified by the number of their vertex. Input: a nested list graph list that represents a graph as an adjacency list, that models the friendships at Monash; and a non-negative integer n. Output: a list of integers, where each integer is a person with at least n friends. If no person has at least n friends, return an empty list. The list may be in any order. Examples clayton_list = , , , , ] The example graph clayton list is provided for illustrative purpose. Your implemented function must be able to handle arbitrary graphs in list form. Calling popular(clayton list,2) returns . Calling popular(clayton list,3) returns . Calling popular(clayton list,0) returns .
Part B: Friend of a Friend (1.5 Marks)
Write a function foaf(graph matrix, person1, person2) that determines whether two people have exactly one degree of separation: that is, whether two (distinct) people are not friends, but have at least one friend in common. Input: a nested list graph matrix that represents a graph as an adjacency matrix, that models the friendships at Monash; an integer person1, and an integer person2, where 0 ≤person1, person2< number of people on campus, and person16= person2. Output: a boolean, True if the two people are not friends and they have at least one friend in common; otherwise False. Examples clayton_matrix = , , , , ] The example graph clayton matrix is provided for illustrative purpose. Your implemented function must be able to handle arbitrary graphs in matrix form. Calling foaf(clayton matrix,0,4) returns True as 0 and 4 are both friends with 2. Calling foaf(clayton matrix,0,3) returns False as 0 and 3 are friends directly. Calling foaf(clayton matrix,1,4) returns False as 1 and 4 have no friends in common.
Part C: Society (1.5 Marks)
Write a function society(graph matrix, person) that determines whether a person has two friends who are also friends with each other. Input: a nested list graph matrix that represents a graph as an adjacency matrix, that models the friendships at Monash; and an integer person, where 0 ≤person< number of people on campus. Output: a boolean, True if person has at least two friends who are also friends with each other; otherwise False. Examples Calling society(clayton matrix,0) returns True as 1 and 3 are both friends with 0. Calling society(clayton matrix,2) returns False as 2 is friends with 0 and 4, but 0 and 4 are not friends with each other.
Marking Guide (total 4.5 marks)
Marks are given for the correct behavior of the different functions: 5 marks for popular. 5 marks for foaf. 5 marks for society.
Task 3: Cards (4 Marks)
A friend of yours is developing a prototype for a website on which people can play poker. They have contacted you to help them implement some of the project’s backend: specifically, they would like some help telling what kind of hand a player has played. You have agreed to implement four functions to assist them. In the backend, your friend has decided to represent cards as tuples comprising an integer and a string: (rank, suit). For example, the seven of clubs would be represented as (7, ‘C’). As this is a prototype, your friend has told you that no face cards will be used (that is, rank is always an integer, where 2 ≤ rank ≤ 10, unless otherwise specified). There are four suits, with the following string representations: clubs: ‘C’, diamonds: ‘D’, hearts: ‘H’, spades: ‘S’. As this is poker, which is only played with one deck of cards, there will never be duplicates, and each hand will contain exactly five cards. Create a Python module called cards.py. Within this module implement the following four tasks. For this module you may not use the Python inbuilt function sorted() or the Python method list.sort(). You may not import any other libraries or modules.
Part A: Suits (1 Mark)
Write a function suits(hand) that sorts a given hand into the four suits. As there is no standard ranking of suits in poker, we will order alphabetically: clubs, diamonds, hearts, spades. Input: a list hand containing five cards. Output: a nested list containing four lists of cards, with each internal list corresponding to a suit. If there are no cards of that suit in the hand, the internal list for that suit is empty. Cards may be in any order within their suit-list.
Part B: Flush (1 Mark)
Write a function flush(hand) that determines whether a given hand is a flush. In poker, a flush is a hand that contains five cards of the same suit. Input: a list hand containing five cards. Output: a boolean, True if all five cards in hand are the same suit, False if not.
Part C: Straight (2 Marks)
Write a function straight(hand) that determines whether a given hand is a straight. In poker, a straight is a hand that contains five cards of sequential rank. The cards may be of different suits. Your friend has asked you an additional favour: they would like to use this function in various other games they may implement in the future, so instead of checking for a five-card straight, they would like you to check for an n card straight, where n is the number of cards in the hand. Like in poker, the cards may be of different suits. Input: a list hand containing at least three cards, where each card may have a rank of some number greater than zero. Output: a boolean, True if the ranks of the cards in hand may be ordered into an unbroken sequence with no rank duplicated, False if not.
Examples
Calling suits() returns , , , ]. As there are multiple clubs, the clubs cards may be in any order within their internal list. Calling flush() returns True. Calling flush() returns False. Calling straight() returns True. Calling straight() returns False. Calling straight() returns False. Calling straight() returns True as the ranks of the cards form an unbroken sequence, , with no rank duplicated.
Marking Guide (total 4 marks)
Marks are given for the correct behavior of the different functions: 1 mark for suits. 1 mark for flush. 1 mark for straight if it is able to handle a normal poker five-card hand with card ranks between 2 and 10 inclusive (see Examples d, e, and f); 2 marks for straight if it is able to handle an arbitrarily large hand with arbitrary ranks (see Example g). The functions may return True or False at your discretion for instances where person1 is person2. This case will not be marked. Read the full article
0 notes